Disable the interactive dismissal of presented view controller
Master System Design with Codemia
Enhance your system design skills with over 120 practice problems, detailed solutions, and hands-on exercises.
Introduction
On modern iOS, a presented view controller can often be dismissed interactively by pulling down on a sheet-style presentation. If you want to block that gesture, the simplest solution is usually isModalInPresentation = true. If you also want to decide dynamically or react when the user tries to dismiss, use the presentation controller delegate methods.
The Simplest Way: isModalInPresentation
For many cases, this is enough.
With this property set to true, the system prevents interactive dismissal for that presented controller. This is the standard answer for “disable swipe-to-dismiss.”
When This Is Useful
Typical situations include:
- unsaved form changes,
- multi-step flows that must finish or cancel explicitly,
- onboarding or permission explanation screens,
- destructive states where accidental dismissal would confuse the user.
The goal is not to trap the user arbitrarily. It is to make dismissal explicit when accidental gesture-based dismissal would be harmful.
Use The Presentation Controller Delegate For More Control
If you need dynamic behavior, attach a delegate to the presentation controller.
This lets you allow dismissal only when your own conditions are satisfied.
Static Blocking Versus Dynamic Blocking
There is an important design difference:
- '
isModalInPresentation = trueis a static block,' - '
presentationControllerShouldDismisslets you decide at runtime.'
If the rule is simply “never allow interactive dismissal on this screen,” the property is simpler. If the rule is “allow dismissal only after save completes,” the delegate is usually better.
Remember Programmatic Dismissal Still Works
Blocking interactive dismissal does not prevent your code from dismissing the controller.
That is an important distinction. The setting stops the gesture-based interactive dismissal, not every possible dismissal path.
Sheet Presentations Are The Common Context
This issue appears most often with .pageSheet or .formSheet style presentations on iOS 13 and later, where the pull-down gesture feels natural to users. If you present full screen, the interactive dismissal behavior may differ because the presentation style itself changed.
So if the behavior seems inconsistent, check the modal presentation style as well as the dismissal settings.
UX Matters Too
Disabling interactive dismissal is technically easy, but do not leave the user without an obvious exit path. If the sheet cannot be swiped away, provide clear buttons such as:
- Save,
- Cancel,
- Discard Changes.
A blocked gesture without an explicit alternative usually feels broken rather than intentional.
Common Pitfalls
- Expecting
isModalInPresentationto block all programmatic dismissal, which it does not. - Forgetting to set the presentation controller delegate when using dynamic dismissal rules.
- Disabling interactive dismissal without giving the user a visible way to leave the screen.
- Assuming all modal presentation styles behave the same way across iOS versions.
- Solving a UX problem with dismissal blocking when the better fix is clearer save or cancel flow design.
Summary
- Use
isModalInPresentation = trueto disable interactive sheet dismissal quickly. - Use
UIAdaptivePresentationControllerDelegatewhen the rule should be evaluated dynamically. - Blocking interactive dismissal does not stop your own code from calling
dismiss. - Check presentation style if behavior seems inconsistent.
- Always provide an explicit user path to exit when swipe dismissal is disabled.

