-
-
Save DabbyNdubisi/c4045a0231435c22be887cb6d9109507 to your computer and use it in GitHub Desktop.
Same here - thanks so much for posting this 🙏🏽
Incredibly useful! I’ve forked the project and added a version that can be toggled on or off with a Boolean switch.
Works like magic. Saved me a day. Thanks!
I'm glad I could help :)
Incredibly useful! I’ve forked the project and added a version that can be toggled on or off with a Boolean switch.
Nice!
Same here - thanks so much for posting this 🙏🏽
🙏
This does not appear to be working on iOS 26.0.
Here is another bit of code that does work though.
This does not appear to be working on iOS 26.0.
Yes I have this fixed in my local but hadn't pushed to the gist yet. Should work now!
Here is another bit of code that does work though.
The SwiftUI direct interactive dismissal api hasn't worked in the past, but I'll check this out to see if anything has changed. For now the gist should work as before accounting for the new zoom gesture added in iOS 26
I also posted a few other solutions here.
Works perfectly on iOS 26.0. Thank you!
Works like a charm, also on iOS 26.1. Thanks!
Given this uses private SPI, can anyone confirm having App Review accept an app that uses this?
@ramikay It was accepted in my case.
Given this uses private SPI, can anyone confirm having App Review accept an app that uses this?
Hey @ramikay, I use these across a few of my projects that are live on the app store.
This solution, while being a bit hacky doesn't abuse any private APIs per se so we should be good. The worst case scenario is Apple changes the name of their gesture recognizers which would just prevent the gestures from working again, but in that case I would notice it broken in my apps as well and provide an update to the gist :)
@vincefried @DabbyNdubisi thanks for your replies!
This solution saved me — it allows me to keep Apple’s native smooth animations while preserving our app’s design.
However, it breaks in the following scenario:
If the design does not allow pinch-to-dismiss but allows swipe-to-dismiss, when the user swipes down slightly and releases (staying on the current page), they can then use pinch to dismiss the page.
If anyone encounters the same issue, instead of disabling the gesture, remove the gesture recognizer directly from the parent view.
Like this:
if !allowedDismissalGestures.contains(/* Your allowed gesture */) {
parentVC.view?.removeGestureRecognizer(gesture)
}
Hope this helps anyone facing the same issue.
Works like magic. Saved me a day. Thanks!