From 360736316c75b26a7ed0b68fd7115d03a60e3b70 Mon Sep 17 00:00:00 2001 From: Hans Seiffert Date: Thu, 1 Sep 2016 12:19:13 +0200 Subject: [PATCH 1/5] Make page changing and scrolling inside pages accessible to the public --- Source/FolioReaderCenter.swift | 60 ++++++----- Source/FolioReaderContainer.swift | 34 ++++--- Source/FolioReaderPage.swift | 160 +++++++++++++++--------------- 3 files changed, 134 insertions(+), 120 deletions(-) diff --git a/Source/FolioReaderCenter.swift b/Source/FolioReaderCenter.swift index aaf626909..dd2bccb9d 100755 --- a/Source/FolioReaderCenter.swift +++ b/Source/FolioReaderCenter.swift @@ -19,7 +19,7 @@ var pageScrollDirection = ScrollDirection() var isScrolling = false -class FolioReaderCenter: UIViewController, UICollectionViewDelegate, UICollectionViewDataSource { +public class FolioReaderCenter: UIViewController, UICollectionViewDelegate, UICollectionViewDataSource { var collectionView: UICollectionView! let collectionViewLayout = UICollectionViewFlowLayout() @@ -48,7 +48,7 @@ class FolioReaderCenter: UIViewController, UICollectionViewDelegate, UICollectio // MARK: - View life cicle - override func viewDidLoad() { + override public func viewDidLoad() { super.viewDidLoad() if (readerConfig.hideBars == true) { @@ -107,7 +107,7 @@ class FolioReaderCenter: UIViewController, UICollectionViewDelegate, UICollectio pageIndicatorView?.reloadView(updateShadow: true) } - override func viewDidLayoutSubviews() { + override public func viewDidLayoutSubviews() { super.viewDidLayoutSubviews() screenBounds = self.view.frame @@ -310,15 +310,15 @@ class FolioReaderCenter: UIViewController, UICollectionViewDelegate, UICollectio // MARK: UICollectionViewDataSource - func numberOfSectionsInCollectionView(collectionView: UICollectionView) -> Int { + public func numberOfSectionsInCollectionView(collectionView: UICollectionView) -> Int { return 1 } - func collectionView(collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { + public func collectionView(collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { return totalPages } - func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath) -> UICollectionViewCell { + public func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath) -> UICollectionViewCell { let cell = collectionView.dequeueReusableCellWithReuseIdentifier(reuseIdentifier, forIndexPath: indexPath) as! FolioReaderPage cell.pageNumber = indexPath.row+1 @@ -406,7 +406,7 @@ class FolioReaderCenter: UIViewController, UICollectionViewDelegate, UICollectio // MARK: - Device rotation - override func willRotateToInterfaceOrientation(toInterfaceOrientation: UIInterfaceOrientation, duration: NSTimeInterval) { + override public func willRotateToInterfaceOrientation(toInterfaceOrientation: UIInterfaceOrientation, duration: NSTimeInterval) { guard FolioReader.isReaderReady else { return } setPageSize(toInterfaceOrientation) @@ -458,7 +458,7 @@ class FolioReaderCenter: UIViewController, UICollectionViewDelegate, UICollectio self.currentOrientation = toInterfaceOrientation } - override func didRotateFromInterfaceOrientation(fromInterfaceOrientation: UIInterfaceOrientation) { + override public func didRotateFromInterfaceOrientation(fromInterfaceOrientation: UIInterfaceOrientation) { guard FolioReader.isReaderReady else { return } guard let currentPage = currentPage else { return } @@ -481,7 +481,7 @@ class FolioReaderCenter: UIViewController, UICollectionViewDelegate, UICollectio currentPage.webView.scrollView.setContentOffset(pageOffsetPoint, animated: true) } - override func willAnimateRotationToInterfaceOrientation(toInterfaceOrientation: UIInterfaceOrientation, duration: NSTimeInterval) { + override public func willAnimateRotationToInterfaceOrientation(toInterfaceOrientation: UIInterfaceOrientation, duration: NSTimeInterval) { guard FolioReader.isReaderReady else { return } self.collectionView.scrollToItemAtIndexPath(NSIndexPath(forRow: currentPageNumber - 1, inSection: 0), atScrollPosition: UICollectionViewScrollPosition.None, animated: false) @@ -614,17 +614,6 @@ class FolioReaderCenter: UIViewController, UICollectionViewDelegate, UICollectio ) } - func changePageWith(page page: Int, animated: Bool = false, completion: (() -> Void)? = nil) { - if page > 0 && page-1 < totalPages { - let indexPath = NSIndexPath(forRow: page-1, inSection: 0) - changePageWith(indexPath: indexPath, animated: animated, completion: { () -> Void in - self.updateCurrentPage({ () -> Void in - completion?() - }) - }) - } - } - func changePageWith(page page: Int, andFragment fragment: String, animated: Bool = false, completion: (() -> Void)? = nil) { if currentPageNumber == page { if let currentPage = currentPage where fragment != "" { @@ -641,7 +630,7 @@ class FolioReaderCenter: UIViewController, UICollectionViewDelegate, UICollectio } } - func changePageWith(href href: String, animated: Bool = false, completion: (() -> Void)? = nil) { + func changePageWith(href href: String, animated: Bool = false, completion: (() -> Void)? = nil) { let item = findPageByHref(href) let indexPath = NSIndexPath(forRow: item, inSection: 0) changePageWith(indexPath: indexPath, animated: animated, completion: { () -> Void in @@ -682,7 +671,7 @@ class FolioReaderCenter: UIViewController, UICollectionViewDelegate, UICollectio completion?() } } - + func indexPathIsValid(indexPath: NSIndexPath) -> Bool { let section = indexPath.section let row = indexPath.row @@ -773,6 +762,23 @@ class FolioReaderCenter: UIViewController, UICollectionViewDelegate, UICollectio } return nil } + + // MARK: Public page methods + + public func changePageWith(page page: Int, animated: Bool = false, completion: (() -> Void)? = nil) { + if page > 0 && page-1 < totalPages { + let indexPath = NSIndexPath(forRow: page-1, inSection: 0) + changePageWith(indexPath: indexPath, animated: animated, completion: { () -> Void in + self.updateCurrentPage({ () -> Void in + completion?() + }) + }) + } + } + + public func getCurrentPage() -> FolioReaderPage? { + return self.currentPage + } // MARK: - Audio Playing @@ -898,7 +904,7 @@ class FolioReaderCenter: UIViewController, UICollectionViewDelegate, UICollectio // MARK: - ScrollView Delegate - func scrollViewWillBeginDragging(scrollView: UIScrollView) { + public func scrollViewWillBeginDragging(scrollView: UIScrollView) { isScrolling = true clearRecentlyScrolled() recentlyScrolled = true @@ -912,7 +918,7 @@ class FolioReaderCenter: UIViewController, UICollectionViewDelegate, UICollectio scrollScrubber?.scrollViewWillBeginDragging(scrollView) } - func scrollViewDidScroll(scrollView: UIScrollView) { + public func scrollViewDidScroll(scrollView: UIScrollView) { if !navigationController!.navigationBarHidden { toggleBars() @@ -950,7 +956,7 @@ class FolioReaderCenter: UIViewController, UICollectionViewDelegate, UICollectio pageScrollDirection = scrollView.contentOffset.forDirection() < pointNow.forDirection() ? .negative() : .positive() } - func scrollViewDidEndDecelerating(scrollView: UIScrollView) { + public func scrollViewDidEndDecelerating(scrollView: UIScrollView) { isScrolling = false if (readerConfig.scrollDirection == .horizontalWithVerticalContent), @@ -966,7 +972,7 @@ class FolioReaderCenter: UIViewController, UICollectionViewDelegate, UICollectio scrollScrubber?.scrollViewDidEndDecelerating(scrollView) } - func scrollViewDidEndDragging(scrollView: UIScrollView, willDecelerate decelerate: Bool) { + public func scrollViewDidEndDragging(scrollView: UIScrollView, willDecelerate decelerate: Bool) { recentlyScrolledTimer = NSTimer(timeInterval:recentlyScrolledDelay, target: self, selector: #selector(FolioReaderCenter.clearRecentlyScrolled), userInfo: nil, repeats: false) NSRunLoop.currentRunLoop().addTimer(recentlyScrolledTimer, forMode: NSRunLoopCommonModes) } @@ -979,7 +985,7 @@ class FolioReaderCenter: UIViewController, UICollectionViewDelegate, UICollectio recentlyScrolled = false } - func scrollViewDidEndScrollingAnimation(scrollView: UIScrollView) { + public func scrollViewDidEndScrollingAnimation(scrollView: UIScrollView) { scrollScrubber?.scrollViewDidEndScrollingAnimation(scrollView) } diff --git a/Source/FolioReaderContainer.swift b/Source/FolioReaderContainer.swift index 05ab048a9..5ef3a6d20 100755 --- a/Source/FolioReaderContainer.swift +++ b/Source/FolioReaderContainer.swift @@ -17,7 +17,7 @@ var book: FRBook! /// Reader container public class FolioReaderContainer: UIViewController { var centerNavigationController: UINavigationController! - var centerViewController: FolioReaderCenter! + var centerViewController: FolioReaderCenter! var audioPlayer: FolioReaderAudioPlayer! var shouldHideStatusBar = true private var errorOnLoad = false @@ -156,19 +156,6 @@ public class FolioReaderContainer: UIViewController { // MARK: - Helpers - /* - Set the `FolioReaderConfig` and epubPath. - - - parameter config: A instance of `FolioReaderConfig` - - parameter path: The ePub path on system - - parameter removeEpub: Should delete the original file after unzip? Default to `true` so the ePub will be unziped only once. - */ - public class func setupConfig(config: FolioReaderConfig, epubPath path: String, removeEpub: Bool = true) { - readerConfig = config - epubPath = path - shouldRemoveEpub = removeEpub - } - private static func initSetup() { // Init with empty book @@ -192,4 +179,23 @@ public class FolioReaderContainer: UIViewController { readerConfig.canChangeScrollDirection = isDirection(readerConfig.canChangeScrollDirection, readerConfig.canChangeScrollDirection, false) } + // MARK: - Public + + /* + Set the `FolioReaderConfig` and epubPath. + + - parameter config: A instance of `FolioReaderConfig` + - parameter path: The ePub path on system + - parameter removeEpub: Should delete the original file after unzip? Default to `true` so the ePub will be unziped only once. + */ + public class func setupConfig(config: FolioReaderConfig, epubPath path: String, removeEpub: Bool = true) { + readerConfig = config + epubPath = path + shouldRemoveEpub = removeEpub + } + + public func readerCenter() -> FolioReaderCenter { + return self.centerViewController + } + } diff --git a/Source/FolioReaderPage.swift b/Source/FolioReaderPage.swift index f9a093beb..8d89fd54e 100755 --- a/Source/FolioReaderPage.swift +++ b/Source/FolioReaderPage.swift @@ -20,7 +20,7 @@ protocol FolioReaderPageDelegate: class { func pageDidLoad(page: FolioReaderPage) } -class FolioReaderPage: UICollectionViewCell, UIWebViewDelegate, UIGestureRecognizerDelegate { +public class FolioReaderPage: UICollectionViewCell, UIWebViewDelegate, UIGestureRecognizerDelegate { weak var delegate: FolioReaderPageDelegate? var pageNumber: Int! @@ -31,7 +31,7 @@ class FolioReaderPage: UICollectionViewCell, UIWebViewDelegate, UIGestureRecogni // MARK: - View life cicle - override init(frame: CGRect) { + override public init(frame: CGRect) { super.init(frame: frame) self.backgroundColor = UIColor.clearColor() @@ -62,7 +62,7 @@ class FolioReaderPage: UICollectionViewCell, UIWebViewDelegate, UIGestureRecogni webView.addGestureRecognizer(tapGestureRecognizer) } - required init?(coder aDecoder: NSCoder) { + required public init?(coder aDecoder: NSCoder) { fatalError("storyboards are incompatible with truth and beauty") } @@ -70,7 +70,7 @@ class FolioReaderPage: UICollectionViewCell, UIWebViewDelegate, UIGestureRecogni NSNotificationCenter.defaultCenter().removeObserver(self) } - override func layoutSubviews() { + override public func layoutSubviews() { super.layoutSubviews() webView.setupScrollDirection() @@ -135,7 +135,7 @@ class FolioReaderPage: UICollectionViewCell, UIWebViewDelegate, UIGestureRecogni // MARK: - UIWebView Delegate - func webViewDidFinishLoad(webView: UIWebView) { + public func webViewDidFinishLoad(webView: UIWebView) { refreshPageMode() if readerConfig.enableTTS && !book.hasAudio() { @@ -160,7 +160,7 @@ class FolioReaderPage: UICollectionViewCell, UIWebViewDelegate, UIGestureRecogni delegate?.pageDidLoad(self) } - func webView(webView: UIWebView, shouldStartLoadWithRequest request: NSURLRequest, navigationType: UIWebViewNavigationType) -> Bool { + public func webView(webView: UIWebView, shouldStartLoadWithRequest request: NSURLRequest, navigationType: UIWebViewNavigationType) -> Bool { guard let url = request.URL else { return false } @@ -249,7 +249,7 @@ class FolioReaderPage: UICollectionViewCell, UIWebViewDelegate, UIGestureRecogni // MARK: Gesture recognizer - func gestureRecognizer(gestureRecognizer: UIGestureRecognizer, shouldRecognizeSimultaneouslyWithGestureRecognizer otherGestureRecognizer: UIGestureRecognizer) -> Bool { + public func gestureRecognizer(gestureRecognizer: UIGestureRecognizer, shouldRecognizeSimultaneouslyWithGestureRecognizer otherGestureRecognizer: UIGestureRecognizer) -> Bool { if gestureRecognizer.view is UIWebView { if otherGestureRecognizer is UILongPressGestureRecognizer { @@ -263,7 +263,7 @@ class FolioReaderPage: UICollectionViewCell, UIWebViewDelegate, UIGestureRecogni return false } - func handleTapGesture(recognizer: UITapGestureRecognizer) { + public func handleTapGesture(recognizer: UITapGestureRecognizer) { // webView.setMenuVisible(false) if FolioReader.sharedInstance.readerCenter.navigationController!.navigationBarHidden { @@ -291,82 +291,84 @@ class FolioReaderPage: UICollectionViewCell, UIWebViewDelegate, UIGestureRecogni // Reset menu menuIsVisible = false } - - // MARK: - Scroll and positioning - - /** - Scrolls the page to a given offset - - - parameter offset: The offset to scroll - - parameter animated: Enable or not scrolling animation - */ - func scrollPageToOffset(offset: CGFloat, animated: Bool) { + + // MARK: - Public scroll postion setter + + /** + Scrolls the page to a given offset + + - parameter offset: The offset to scroll + - parameter animated: Enable or not scrolling animation + */ + public func scrollPageToOffset(offset: CGFloat, animated: Bool) { let pageOffsetPoint = isDirection(CGPoint(x: 0, y: offset), CGPoint(x: offset, y: 0), CGPoint(x: 0, y: offset)) webView.scrollView.setContentOffset(pageOffsetPoint, animated: animated) } - - /** - Scrolls the page to bottom - */ - func scrollPageToBottom() { - let bottomOffset = isDirection( - CGPointMake(0, webView.scrollView.contentSize.height - webView.scrollView.bounds.height), - CGPointMake(webView.scrollView.contentSize.width - webView.scrollView.bounds.width, 0), - CGPointMake(webView.scrollView.contentSize.width - webView.scrollView.bounds.width, 0) - ) - - if bottomOffset.forDirection() >= 0 { - dispatch_async(dispatch_get_main_queue(), { - self.webView.scrollView.setContentOffset(bottomOffset, animated: false) - }) - } - } - - /** - Handdle #anchors in html, get the offset and scroll to it - - - parameter anchor: The #anchor - - parameter avoidBeginningAnchors: Sometimes the anchor is on the beggining of the text, there is not need to scroll - - parameter animated: Enable or not scrolling animation - */ - func handleAnchor(anchor: String, avoidBeginningAnchors: Bool, animated: Bool) { - if !anchor.isEmpty { - let offset = getAnchorOffset(anchor) - - if readerConfig.scrollDirection == .vertical { - let isBeginning = offset < frame.forDirection()/2 - - if !avoidBeginningAnchors { - scrollPageToOffset(offset, animated: animated) - } else if avoidBeginningAnchors && !isBeginning { - scrollPageToOffset(offset, animated: animated) - } - } else { - scrollPageToOffset(offset, animated: animated) - } - } - } - - /** - Get the #anchor offset in the page - - - parameter anchor: The #anchor id - - returns: The element offset ready to scroll - */ - func getAnchorOffset(anchor: String) -> CGFloat { - let horizontal = readerConfig.scrollDirection == .horizontal - if let strOffset = webView.js("getAnchorOffset('\(anchor)', \(horizontal.description))") { - return CGFloat((strOffset as NSString).floatValue) - } - - return CGFloat(0) - } - + + /** + Scrolls the page to bottom + */ + public func scrollPageToBottom() { + let bottomOffset = isDirection( + CGPointMake(0, webView.scrollView.contentSize.height - webView.scrollView.bounds.height), + CGPointMake(webView.scrollView.contentSize.width - webView.scrollView.bounds.width, 0), + CGPointMake(webView.scrollView.contentSize.width - webView.scrollView.bounds.width, 0) + ) + + if bottomOffset.forDirection() >= 0 { + dispatch_async(dispatch_get_main_queue(), { + self.webView.scrollView.setContentOffset(bottomOffset, animated: false) + }) + } + } + + /** + Handdle #anchors in html, get the offset and scroll to it + + - parameter anchor: The #anchor + - parameter avoidBeginningAnchors: Sometimes the anchor is on the beggining of the text, there is not need to scroll + - parameter animated: Enable or not scrolling animation + */ + public func handleAnchor(anchor: String, avoidBeginningAnchors: Bool, animated: Bool) { + if !anchor.isEmpty { + let offset = getAnchorOffset(anchor) + + if readerConfig.scrollDirection == .vertical { + let isBeginning = offset < frame.forDirection()/2 + + if !avoidBeginningAnchors { + scrollPageToOffset(offset, animated: animated) + } else if avoidBeginningAnchors && !isBeginning { + scrollPageToOffset(offset, animated: animated) + } + } else { + scrollPageToOffset(offset, animated: animated) + } + } + } + + // MARK: Helper + + /** + Get the #anchor offset in the page + + - parameter anchor: The #anchor id + - returns: The element offset ready to scroll + */ + func getAnchorOffset(anchor: String) -> CGFloat { + let horizontal = readerConfig.scrollDirection == .horizontal + if let strOffset = webView.js("getAnchorOffset('\(anchor)', \(horizontal.description))") { + return CGFloat((strOffset as NSString).floatValue) + } + + return CGFloat(0) + } + // MARK: Mark ID - + /** Audio Mark ID - marks an element with an ID with the given class and scrolls to it - + - parameter ID: The ID */ func audioMarkID(ID: String) { @@ -376,7 +378,7 @@ class FolioReaderPage: UICollectionViewCell, UIWebViewDelegate, UIGestureRecogni // MARK: UIMenu visibility - override func canPerformAction(action: Selector, withSender sender: AnyObject?) -> Bool { + override public func canPerformAction(action: Selector, withSender sender: AnyObject?) -> Bool { if UIMenuController.sharedMenuController().menuItems?.count == 0 { webView.isColors = false webView.createMenu(options: false) From eaee636a2b9e32a2dfdd00f11b89aeeb84435036 Mon Sep 17 00:00:00 2001 From: Hans Seiffert Date: Fri, 2 Sep 2016 16:46:16 +0200 Subject: [PATCH 2/5] Remove old init() method --- Source/FolioReaderContainer.swift | 40 +------------------------------ 1 file changed, 1 insertion(+), 39 deletions(-) diff --git a/Source/FolioReaderContainer.swift b/Source/FolioReaderContainer.swift index b4b0f426d..2d9ca88f0 100755 --- a/Source/FolioReaderContainer.swift +++ b/Source/FolioReaderContainer.swift @@ -189,45 +189,7 @@ public class FolioReaderContainer: UIViewController { return isNight(.LightContent, .Default) } - // MARK: - Helpers - - private static func initSetup() { - - // Init with empty book - book = FRBook() - - // Register custom fonts - FontBlaster.blast(NSBundle.frameworkBundle()) - - // Register initial defaults - FolioReader.defaults.registerDefaults([ - kCurrentFontFamily: 0, - kNightMode: false, - kCurrentFontSize: 2, - kCurrentAudioRate: 1, - kCurrentHighlightStyle: 0, - kCurrentTOCMenu: 0, - kCurrentMediaOverlayStyle: MediaOverlayStyle.Default.rawValue, - kCurrentScrollDirection: FolioReaderScrollDirection.vertical.rawValue - ]) - - readerConfig.canChangeScrollDirection = isDirection(readerConfig.canChangeScrollDirection, readerConfig.canChangeScrollDirection, false) - } - - // MARK: - Public - - /* - Set the `FolioReaderConfig` and epubPath. - - - parameter config: A instance of `FolioReaderConfig` - - parameter path: The ePub path on system - - parameter removeEpub: Should delete the original file after unzip? Default to `true` so the ePub will be unziped only once. - */ - public class func setupConfig(config: FolioReaderConfig, epubPath path: String, removeEpub: Bool = true) { - readerConfig = config - epubPath = path - shouldRemoveEpub = removeEpub - } + // MARK: - Public public func readerCenter() -> FolioReaderCenter { return self.centerViewController From f0eec1f81de8ff7a93fda635083f121aa5b7dd3a Mon Sep 17 00:00:00 2001 From: Hans Seiffert Date: Mon, 5 Sep 2016 10:05:40 +0200 Subject: [PATCH 3/5] Remove unneeded public `FolioReaderCenter` getter --- Source/FolioReaderContainer.swift | 7 ------- 1 file changed, 7 deletions(-) diff --git a/Source/FolioReaderContainer.swift b/Source/FolioReaderContainer.swift index 2d9ca88f0..3048c2259 100755 --- a/Source/FolioReaderContainer.swift +++ b/Source/FolioReaderContainer.swift @@ -188,11 +188,4 @@ public class FolioReaderContainer: UIViewController { override public func preferredStatusBarStyle() -> UIStatusBarStyle { return isNight(.LightContent, .Default) } - - // MARK: - Public - - public func readerCenter() -> FolioReaderCenter { - return self.centerViewController - } - } From 34228a629ab03d3777a641c86dffc798f50c71b5 Mon Sep 17 00:00:00 2001 From: Hans Seiffert Date: Mon, 5 Sep 2016 10:06:13 +0200 Subject: [PATCH 4/5] Add documentation for the public `changePathWith` method --- Source/FolioReaderCenter.swift | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Source/FolioReaderCenter.swift b/Source/FolioReaderCenter.swift index 25c4d255f..6d3f6ab95 100755 --- a/Source/FolioReaderCenter.swift +++ b/Source/FolioReaderCenter.swift @@ -764,6 +764,13 @@ public class FolioReaderCenter: UIViewController, UICollectionViewDelegate, UICo // MARK: Public page methods + /** + Changes the current page of the reader. + + - parameter page: The target page index. Note: The page index starts at 1 (and not 0). + - parameter animated: En-/Disables the animation of the page change. + - parameter completion: A Closure which is called if the page change is completed. + */ public func changePageWith(page page: Int, animated: Bool = false, completion: (() -> Void)? = nil) { if page > 0 && page-1 < totalPages { let indexPath = NSIndexPath(forRow: page-1, inSection: 0) From 4eea438cbae92737aac09b53610c088e510775e6 Mon Sep 17 00:00:00 2001 From: Hans Seiffert Date: Mon, 5 Sep 2016 10:06:53 +0200 Subject: [PATCH 5/5] Refactor public current page retrieving by using a `public private(set)` property --- Source/FolioReaderCenter.swift | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/Source/FolioReaderCenter.swift b/Source/FolioReaderCenter.swift index 6d3f6ab95..29d13cd6b 100755 --- a/Source/FolioReaderCenter.swift +++ b/Source/FolioReaderCenter.swift @@ -27,7 +27,7 @@ public class FolioReaderCenter: UIViewController, UICollectionViewDelegate, UICo var pages: [String]! var totalPages: Int! var tempFragment: String? - var currentPage: FolioReaderPage? + public private(set) var currentPage: FolioReaderPage? var animator: ZFModalTransitionAnimator! var pageIndicatorView: FolioReaderPageIndicator? var pageIndicatorHeight: CGFloat = 20 @@ -781,10 +781,6 @@ public class FolioReaderCenter: UIViewController, UICollectionViewDelegate, UICo }) } } - - public func getCurrentPage() -> FolioReaderPage? { - return self.currentPage - } // MARK: - Audio Playing