Skip to content

Commit e114f06

Browse files
committed
isScrollEnabled exposed to public api as intended
fixed wrong current index calculation for not layouted views
1 parent 90b9206 commit e114f06

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Source/SlideController.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ public class SlideController<T, N>: NSObject, UIScrollViewDelegate, ControllerSl
223223
contentSlidableController.slideContentView.changeLayoutAction = changeContentLayoutAction
224224
}
225225

226-
var isScrollEnabled: Bool = true {
226+
public var isScrollEnabled: Bool = true {
227227
didSet {
228228
contentSlidableController.slideContentView.isScrollEnabled = isScrollEnabled
229229
}
@@ -329,7 +329,9 @@ public class SlideController<T, N>: NSObject, UIScrollViewDelegate, ControllerSl
329329

330330
if index < currentIndex {
331331
shift(pageIndex: currentIndex - 1, animated: false)
332-
currentIndex = currentIndex - 1
332+
if contentSlidableController.slideContentView.isLayouted {
333+
currentIndex = currentIndex - 1
334+
}
333335
} else if index == currentIndex {
334336
/// TODO: check this case
335337
if currentIndex < content.count {

0 commit comments

Comments
 (0)