Disable the interactive dismissal of presented view controller

前端 未结 5 985
星月不相逢
星月不相逢 2020-12-07 08:48

iOS 13 introduces a new design of modalPresentationStyle .pageSheet (and its sibling .formSheet) for modally presente

5条回答
  •  甜味超标
    2020-12-07 09:34

    1. If you want the same behaviour as it's in previous iOS version (< iOS13) like model presentation in fullscreen, just set the presentation style of your destination view controller to UIModalPresentationStyle.fullScreen

      let someViewController = \*VIEW CONTROLLER*\
      someViewController.modalPresentationStyle = .fullScreen
      

      And if you are using storyboard just select the segua and select Full Screen form the Presentation dropdown.

    2. If you just want to disable the interactive dismissal and keep the new presentation style set UIViewController property isModalInPresentation to true.

      if #available(iOS 13.0, *) {
          someViewController.isModalInPresentation = true // available in IOS13
      }
      

提交回复
热议问题