Skip to content

Commit

Permalink
isScrollEnabled exposed to public api as intended
Browse files Browse the repository at this point in the history
fixed wrong current index calculation for not layouted views
  • Loading branch information
pkandrashkou committed Feb 13, 2018
1 parent 90b9206 commit e114f06
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Source/SlideController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ public class SlideController<T, N>: NSObject, UIScrollViewDelegate, ControllerSl
contentSlidableController.slideContentView.changeLayoutAction = changeContentLayoutAction
}

var isScrollEnabled: Bool = true {
public var isScrollEnabled: Bool = true {
didSet {
contentSlidableController.slideContentView.isScrollEnabled = isScrollEnabled
}
Expand Down Expand Up @@ -329,7 +329,9 @@ public class SlideController<T, N>: NSObject, UIScrollViewDelegate, ControllerSl

if index < currentIndex {
shift(pageIndex: currentIndex - 1, animated: false)
currentIndex = currentIndex - 1
if contentSlidableController.slideContentView.isLayouted {
currentIndex = currentIndex - 1
}
} else if index == currentIndex {
/// TODO: check this case
if currentIndex < content.count {
Expand Down

0 comments on commit e114f06

Please sign in to comment.