FolioReaderCenter
open class FolioReaderCenter : UIViewController, UICollectionViewDelegate, UICollectionViewDataSource, UICollectionViewDelegateFlowLayout
The base reader class
-
This delegate receives the events from the current
FolioReaderPage
s delegate.Declaration
Swift
open weak var delegate: FolioReaderCenterDelegate?
-
This delegate receives the events from current page
Declaration
Swift
open weak var pageDelegate: FolioReaderPageDelegate?
-
The base reader container
Declaration
Swift
open weak var readerContainer: FolioReaderContainer?
-
The current visible page on reader
Declaration
Swift
open fileprivate(set) var currentPage: FolioReaderPage?
-
The collection view with pages
Declaration
Swift
open var collectionView: UICollectionView!
-
Declaration
Swift
required public init?(coder aDecoder: NSCoder)
-
Declaration
Swift
override open func viewDidLoad()
-
Declaration
Swift
override open func viewWillAppear(_ animated: Bool)
-
Declaration
Swift
override open func viewDidLayoutSubviews()
-
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 withchangePageWith
.Declaration
Swift
open func enableScrollBetweenChapters(scrollEnabled: Bool)
Parameters
scrollEnabled
Bool
which enables or disables the scrolling betweenFolioReaderPage
s.
-
Declaration
Swift
open func numberOfSections(in collectionView: UICollectionView) -> Int
-
Declaration
Swift
open func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int
-
Declaration
Swift
open func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell
-
Declaration
Swift
public func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize
-
Declaration
Swift
override open func willRotate(to toInterfaceOrientation: UIInterfaceOrientation, duration: TimeInterval)
-
Declaration
Swift
override open func didRotate(from fromInterfaceOrientation: UIInterfaceOrientation)
-
Declaration
Swift
override open func willAnimateRotation(to toInterfaceOrientation: UIInterfaceOrientation, duration: TimeInterval)
-
Declaration
Swift
open func changePageWith(page: Int, andFragment fragment: String, animated: Bool = false, completion: (() -> Void)? = nil)
-
Declaration
Swift
open func changePageWith(href: String, animated: Bool = false, completion: (() -> Void)? = nil)
-
Declaration
Swift
open func changePageWith(href: String, andAudioMarkID markID: String)
-
Declaration
Swift
open func changePageWith(indexPath: IndexPath, animated: Bool = false, completion: (() -> Void)? = nil)
-
Declaration
Swift
open func changePageWith(href: String, pageItem: Int, animated: Bool = false, completion: (() -> Void)? = nil)
-
Declaration
Swift
open func isLastPage() -> Bool
-
Declaration
Swift
public func changePageToNext(_ completion: (() -> Void)? = nil)
-
Declaration
Swift
public func changePageToPrevious(_ completion: (() -> Void)? = nil)
-
Declaration
Swift
public func changePageItemToNext(_ completion: (() -> Void)? = nil)
-
Declaration
Swift
public func getCurrentPageItemNumber() -> Int
-
Declaration
Swift
public func getCurrentPageProgress() -> Float
-
Declaration
Swift
public func changePageItemToPrevious(_ completion: (() -> Void)? = nil)
-
Declaration
Swift
public func changePageItemToLast(animated: Bool = true, _ completion: (() -> Void)? = nil)
-
Declaration
Swift
public func changePageItem(to: Int, animated: Bool = true, completion: (() -> Void)? = nil)
-
Find a page by FRTocReference.
Declaration
Swift
public func findPageByResource(_ reference: FRTocReference) -> Int
-
Find a page by href.
Declaration
Swift
public func findPageByHref(_ href: String) -> Int
-
Find and return the current chapter resource.
Declaration
Swift
public func getCurrentChapter() -> FRResource?
-
Return the current chapter progress based on current chapter and total of chapters.
Declaration
Swift
public func getCurrentChapterProgress() -> CGFloat
-
Find and return the current chapter name.
Declaration
Swift
public func getCurrentChapterName() -> String?
-
Changes the current page of the reader.
Declaration
Swift
public func changePageWith(page: Int, animated: Bool = false, completion: (() -> Void)? = nil)
Parameters
page
The target page index. Note: The page index starts at 1 (and not 0).
animated
En-/Disables the animation of the page change.
completion
A Closure which is called if the page change is completed.
-
Declaration
Swift
open func scrollViewWillBeginDragging(_ scrollView: UIScrollView)
-
Declaration
Swift
open func scrollViewDidScroll(_ scrollView: UIScrollView)
-
Declaration
Swift
open func scrollViewDidEndDecelerating(_ scrollView: UIScrollView)
-
Declaration
Swift
open func scrollViewDidEndDragging(_ scrollView: UIScrollView, willDecelerate decelerate: Bool)
-
Declaration
Swift
open func scrollViewDidEndScrollingAnimation(_ scrollView: UIScrollView)
-
Declaration
Swift
public func pageDidLoad(_ page: FolioReaderPage)
-
Declaration
Swift
public func pageWillLoad(_ page: FolioReaderPage)
-
Declaration
Swift
public func pageTap(_ recognizer: UITapGestureRecognizer)