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

Commit

Permalink
fix: minimap auto hide
Browse files Browse the repository at this point in the history
  • Loading branch information
wzxha committed May 21, 2018
1 parent 7f9ed06 commit ada0f39
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions PhotoBrowser/PhotoPreviewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,11 @@ extension PhotoPreviewController: UIScrollViewDelegate {
}

func scrollViewDidEndDragging(_ scrollView: UIScrollView, willDecelerate decelerate: Bool) {
perform(#selector(hideMiniMap), with: self, afterDelay: 3)
if scrollView.panGestureRecognizer.state == .ended {
perform(#selector(hideMiniMap), with: self, afterDelay: 3)
} else {
NSObject.cancelPreviousPerformRequests(withTarget: self, selector: #selector(hideMiniMap), object: nil)
}
}
}

Expand Down Expand Up @@ -469,7 +473,6 @@ extension PhotoPreviewController {
isPanning = false
panBeginX = 0
panBeginY = 0
perform(#selector(hideMiniMap), with: self, afterDelay: 3)
return
}

Expand Down

0 comments on commit ada0f39

Please sign in to comment.