From 70986c1431681c56385ad6e50f7205be78d8aa9b Mon Sep 17 00:00:00 2001 From: Hans Seiffert Date: Wed, 7 Sep 2016 09:13:26 +0200 Subject: [PATCH 1/2] Add option to en-/disable the scrolling between chapters --- Source/FolioReaderCenter.swift | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Source/FolioReaderCenter.swift b/Source/FolioReaderCenter.swift index 29d13cd6b..5b9b777b6 100755 --- a/Source/FolioReaderCenter.swift +++ b/Source/FolioReaderCenter.swift @@ -76,6 +76,7 @@ public class FolioReaderCenter: UIViewController, UICollectionViewDelegate, UICo collectionView.showsHorizontalScrollIndicator = false collectionView.backgroundColor = background collectionView.decelerationRate = UIScrollViewDecelerationRateFast + enableScrollBetweenChapers(scrollEnabled: true) view.addSubview(collectionView) // Register cell classes @@ -129,6 +130,15 @@ public class FolioReaderCenter: UIViewController, UICollectionViewDelegate, UICo // MARK: Layout + /** + Enable or disable the scrolling between chapters (`FolioReaderPage`s). If this is enabled it's only possible to read the current chapter. If another chapter should be displayed is has to be triggered programmatically with `changePageWith`. + + - parameter scrollEnabled: `Bool` which enables or disables the scrolling between `FolioReaderPage`s. + */ + public func enableScrollBetweenChapers(scrollEnabled scrollEnabled: Bool) { + self.collectionView.scrollEnabled = scrollEnabled + } + private func updateSubviewFrames() { self.pageIndicatorView?.frame = self.frameForPageIndicatorView() self.scrollScrubber?.frame = self.frameForScrollScrubber() From 08a18486f064e1fd519f25605d17486ec15aab08 Mon Sep 17 00:00:00 2001 From: Hans Seiffert Date: Wed, 7 Sep 2016 09:19:22 +0200 Subject: [PATCH 2/2] Fix typo --- Source/FolioReaderCenter.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/FolioReaderCenter.swift b/Source/FolioReaderCenter.swift index 5b9b777b6..51a45fdf5 100755 --- a/Source/FolioReaderCenter.swift +++ b/Source/FolioReaderCenter.swift @@ -76,7 +76,7 @@ public class FolioReaderCenter: UIViewController, UICollectionViewDelegate, UICo collectionView.showsHorizontalScrollIndicator = false collectionView.backgroundColor = background collectionView.decelerationRate = UIScrollViewDecelerationRateFast - enableScrollBetweenChapers(scrollEnabled: true) + enableScrollBetweenChapters(scrollEnabled: true) view.addSubview(collectionView) // Register cell classes @@ -135,7 +135,7 @@ public class FolioReaderCenter: UIViewController, UICollectionViewDelegate, UICo - parameter scrollEnabled: `Bool` which enables or disables the scrolling between `FolioReaderPage`s. */ - public func enableScrollBetweenChapers(scrollEnabled scrollEnabled: Bool) { + public func enableScrollBetweenChapters(scrollEnabled scrollEnabled: Bool) { self.collectionView.scrollEnabled = scrollEnabled }