Skip to content
This repository has been archived by the owner on Feb 8, 2023. It is now read-only.

Commit

Permalink
Merge branch 'feature/fix-pan-bug'
Browse files Browse the repository at this point in the history
  • Loading branch information
liangmingzou committed Apr 4, 2018
2 parents 0d37e1c + 2a77f3c commit 86fe7a3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion PhotoBrowser/PhotoPreviewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ class PhotoPreviewController: UIViewController {

weak var delegate:PhotoPreviewControllerDelegate?

fileprivate let minPanY: CGFloat = -10
fileprivate let maxMoveOfY: CGFloat = 250
fileprivate let minZoom: CGFloat = 0.3
fileprivate let screenWidth: CGFloat = UIScreen.main.bounds.size.width
Expand Down Expand Up @@ -317,7 +318,7 @@ extension PhotoPreviewController: UIScrollViewDelegate {

func scrollViewDidScroll(_ scrollView: UIScrollView) {
scrollNewY = scrollView.contentOffset.y
if (scrollView.contentOffset.y < 0 || isPanning) && !isZooming {
if (scrollView.contentOffset.y < minPanY || isPanning) && !isZooming {
doPan(scrollView.panGestureRecognizer)
}
scrollOldY = scrollNewY
Expand Down

0 comments on commit 86fe7a3

Please sign in to comment.