Skip to content

Commit 9465d8f

Browse files
committed
Fix incorrect usage of allViews over activeViews in rewind. ActiveViews is ordered backwards relative to allViews, so use .last instead of .first
1 parent 7a11f6f commit 9465d8f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ZLSwipeableViewSwift/ZLSwipeableView.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,8 @@ public class ZLSwipeableView: UIView {
147147

148148
guard let view = viewToBeRewinded else { return }
149149

150-
if UInt(allViews().count) == numberOfActiveView && allViews().first != nil {
151-
remove(allViews().first!)
150+
if UInt(activeViews().count) == numberOfActiveView && activeViews().first != nil {
151+
remove(activeViews().last!)
152152
}
153153
insert(view, atIndex: allViews().count)
154154
updateViews()

0 commit comments

Comments
 (0)