Skip to content

Commit

Permalink
Fix interfering other gestures
Browse files Browse the repository at this point in the history
  • Loading branch information
yorikasa committed Mar 12, 2022
1 parent 64dc991 commit 7fef3c8
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ public class BottomSheetContainerViewController: UIViewController {
private func addPanGestureRecognizer() {
let recognizer = UIPanGestureRecognizer(target: self, action: #selector(handlePanGesture(_:)))
view.addGestureRecognizer(recognizer)
recognizer.delegate = self
}

@objc public func handlePanGesture(_ sender: UIPanGestureRecognizer) {
Expand All @@ -75,6 +76,12 @@ public class BottomSheetContainerViewController: UIViewController {
}
}

extension BottomSheetContainerViewController: UIGestureRecognizerDelegate {
public func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldRequireFailureOf otherGestureRecognizer: UIGestureRecognizer) -> Bool {
return true
}
}


public protocol BottomSheetPresenting: UIViewController {
var draggableViewController: BottomSheetContainerViewController? { get set }
Expand Down

0 comments on commit 7fef3c8

Please sign in to comment.