In iOS 13 there is a new behaviour for modal view controller when being presented.
Now it's not fullscreen by default and when I try to slide down, the app just dismiss the View Controller automatically.
How can I prevent this behaviour and get back to the old fullscreen modal vc?
Thanks
With iOS 13, as stated in the Platforms State of the Unionduring the WWDC 2019, Apple introduced a new default card presentation. In order to force the fullscreen you have to specify it explicitly with: let vc = UIViewController() vc.modalPresentationStyle =.fullScreen //or.overFullScreen for transparency
Initially, the default value is fullscreen for modalPresentationStyle, but in iOS 13 its changes to the UIModalPresentationStyle.automatic. If you want to make the full-screen view controller you have to change the modalPresentationStyle to fullScreen.
In the past, Apple has often changed defaults only becoming active once you are linking against the current SDK. We will hopefully get the old behavior when linking against previous versions. I can confirm that Xcode-10 built apps run on the iOS 13 simulator do still default to full screen.
I can confirm that Xcode-10 built apps run on the iOS 13 simulator do still default to full screen. As @DrMickeyLauer said, building with Xcode 11 opts the app in to the new behaviour. Use isModalInPresentation to block the swipe gesture from dismissing. See my blog post for more details: medium.com/@hacknicity/…
With iOS 13, as stated in the Platforms State of the Union during the WWDC 2019, Apple introduced a new default card presentation. In order to force the fullscreen you have to specify it explicitly with:
let vc = UIViewController() vc.modalPresentationStyle = .fullScreen //or .overFullScreen for transparency self.present(vc, animated: true, completion: nil)
I add an information that could be useful for someone. If you have any storyboard segue, to go back to the old style, you need to set the kind property to Present Modally and the Presentation property to Full Screen.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With