SHARE
TWEET

Untitled

a guest May 23rd, 2019 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. private func handlePan(_ recognizer: UIPanGestureRecognizer) {
  2.   ...
  3.   switch recognizer.state {
  4.     case .began:
  5.       ...
  6.     case .changed:
  7.             if internalScrollViewController.scrollView.contentOffset.y > 0 {
  8.                 return
  9.             } else {
  10.                 let maxY = max(SnapPosition.top.computedValue, lastY + deltaY)
  11.                 let minY = min(SnapPosition.bottom.computedValue, maxY)
  12.  
  13.                 containerView.frame = initialFrame.offsetBy(dx: 0, dy: minY)
  14.             }
  15.     case .failed, .ended, .cancelled:
  16.             ...
  17.     default:
  18.         break
  19.     }
  20. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top