iOS 13 introduces a new design of modalPresentationStyle
.pageSheet
(and its sibling .formSheet
) for modally presented view controllers…
…and we can dismiss these sheets by sliding the presented view controller down (interactive dismissal). Although the new "pull-to-dismiss" feature is pretty useful, it may not always be desirable.
THE QUESTION: How can we turn the interactive dismissal off?
– Bear in mind we keep the presentation style the same.
Best Answer
Option 1:
(Disabled interactive
.pageSheet
dismissal acts like this.)UIViewController
contains a new property calledisModalInPresentation
which must be set totrue
to prevent the interactive dismissal..popover
etc.false
by default.Option 2:
UIAdaptivePresentationControllerDelegate
contains a new method calledpresentationControllerShouldDismiss
.isModalInPresentation
property is set tofalse
.