Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private func handlePan(_ recognizer: UIPanGestureRecognizer) {
- ...
- switch recognizer.state {
- case .began:
- ...
- case .changed:
- if internalScrollViewController.scrollView.contentOffset.y > 0 {
- return
- } else {
- let maxY = max(SnapPosition.top.computedValue, lastY + deltaY)
- let minY = min(SnapPosition.bottom.computedValue, maxY)
- containerView.frame = initialFrame.offsetBy(dx: 0, dy: minY)
- }
- case .failed, .ended, .cancelled:
- ...
- default:
- break
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement