Skip to content

Commit 5ff2580

Browse files
committed
fix SheetTransition and Pan gesture conflicts
1 parent fa4cf5f commit 5ff2580

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

Sources/Hero2/BuiltinTransitions/SheetTransition.swift

+8-2
Original file line numberDiff line numberDiff line change
@@ -268,8 +268,14 @@ class SheetPresentationController: UIPresentationController, UIGestureRecognizer
268268
}
269269

270270
func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldRecognizeSimultaneouslyWith otherGestureRecognizer: UIGestureRecognizer) -> Bool {
271-
if let otherPanGR = otherGestureRecognizer as? UIPanGestureRecognizer {
272-
return otherPanGR.minimumNumberOfTouches <= 1
271+
if let otherGestureRecognizer = otherGestureRecognizer as? UIPanGestureRecognizer,
272+
let scrollView = otherGestureRecognizer.view as? UIScrollView,
273+
otherGestureRecognizer.minimumNumberOfTouches <= 1,
274+
otherGestureRecognizer == scrollView.panGestureRecognizer,
275+
scrollView.isScrollEnabled,
276+
scrollView.contentSize.height > scrollView.bounds.inset(by: scrollView.adjustedContentInset).height
277+
{
278+
return true
273279
} else {
274280
return false
275281
}

0 commit comments

Comments
 (0)