Skip to content
This repository has been archived by the owner on Nov 26, 2020. It is now read-only.

Commit

Permalink
Fix fast scroll bug (#379)
Browse files Browse the repository at this point in the history
  • Loading branch information
sunho authored and hebertialmeida committed Feb 21, 2019
1 parent 060c705 commit b718f4f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Source/FolioReaderCenter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1197,6 +1197,10 @@ open class FolioReaderCenter: UIViewController, UICollectionViewDelegate, UIColl
clearRecentlyScrolled()
recentlyScrolled = true
pointNow = scrollView.contentOffset

if (scrollView is UICollectionView) {
scrollView.isUserInteractionEnabled = false
}

if let currentPage = currentPage {
currentPage.webView?.createMenu(options: true)
Expand Down Expand Up @@ -1269,6 +1273,10 @@ open class FolioReaderCenter: UIViewController, UICollectionViewDelegate, UIColl

open func scrollViewDidEndDecelerating(_ scrollView: UIScrollView) {
self.isScrolling = false

if (scrollView is UICollectionView) {
scrollView.isUserInteractionEnabled = true
}

// Perform the page after a short delay as the collection view hasn't completed it's transition if this method is called (the index paths aren't right during fast scrolls).
delay(0.2, closure: { [weak self] in
Expand Down

0 comments on commit b718f4f

Please sign in to comment.