Created
April 8, 2025 07:40
-
-
Save RaajeevChandran/e0fa4fcfec02e9b5f513061125358696 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| extension BottomSheetPresentationController { | |
| private func setupInteraction() { | |
| guard let presentedView = presentedView else { | |
| return | |
| } | |
| func addGestureIfNeeded(_ gesture: UIGestureRecognizer, to view: UIView, delegate: UIGestureRecognizerDelegate? = nil) { | |
| if let recognizers = view.gestureRecognizers, recognizers.contains(gesture) { | |
| return | |
| } | |
| gesture.delegate = delegate | |
| view.addGestureRecognizer(gesture) | |
| } | |
| addGestureIfNeeded(panGesture, to: presentedView, delegate: self) | |
| addGestureIfNeeded(tapGestureToDismiss, to: dimmedBackgroundView) | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment