All Collections
Modal Presentation
Sheet Modifiers
Interactive Dismiss Disabled Modifier
Interactive Dismiss Disabled Modifier

Used to conditionally prevent the interactive dismissal of modal presentations.

Updated over a week ago

Users can dismiss a Sheet by swiping it down. Use the Interactive Dismiss Disabled modifier to conditionally prevent this kind of dismissal. It comes with the Is Disabled parameter which is a Boolean value that indicates whether to prevent the dismissal of the Sheet.

You can either choose True, False, or bind a Property to it to create a Conditional. You typically do this to prevent the user from dismissing a presentation before providing needed data or completing a required action.

For instance, suppose you have a screen that displays a licensing agreement that the user must acknowledge before continuing.

If you present this screen in a Sheet, the user can dismiss it by either tapping the Accept Button—which calls Dismiss from its Action parameter—or by swiping the Sheet down.

To ensure that the user accepts the terms by tapping the Accept Button, apply the Interactive Dismiss Disabled modifier so the Sheet only gets dismissed once they accept the terms and conditions.

Did this answer your question?