Skip to content
This repository was archived by the owner on Nov 26, 2020. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions Source/FolioReaderCenter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ public class FolioReaderCenter: UIViewController, UICollectionViewDelegate, UICo
collectionView.showsHorizontalScrollIndicator = false
collectionView.backgroundColor = background
collectionView.decelerationRate = UIScrollViewDecelerationRateFast
enableScrollBetweenChapters(scrollEnabled: true)
view.addSubview(collectionView)

// Register cell classes
Expand Down Expand Up @@ -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 enableScrollBetweenChapters(scrollEnabled scrollEnabled: Bool) {
self.collectionView.scrollEnabled = scrollEnabled
}

private func updateSubviewFrames() {
self.pageIndicatorView?.frame = self.frameForPageIndicatorView()
self.scrollScrubber?.frame = self.frameForScrollScrubber()
Expand Down