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 dis
I had this problem with a video not presenting fullscreen anymore. Added this line, which saved the day :-)
videoController.modalPresentationStyle = UIModalPresentationFullScreen;
One Liner:
modalPresentationStyle
is required to be set on the navigationController which is being presented.
iOS 13 and below iOS version fullScreen with
overCurrentContext
andnavigationController
Tested Code
let controller = UIViewController()
let navigationController = UINavigationController(rootViewController: controller)
navigationController.modalPresentationStyle = .overCurrentContext
self.navigationController?.present(navigationController, animated: true, completion: nil)
modalPresentationStyle require to set at navigationController.
I needed to do both:
Set presentation style as Full screen
Set Top bar as Translucent Navigation Bar
You can easily do so
Open your storyboard as source code and search for kind="presentation"
, in all the seague tag with kind = presentation add a extra attribute modalPresentationStyle="fullScreen"
Create a category for UIViewController (say UIViewController+PresentationStyle). Add the following code to it.
-(UIModalPresentationStyle)modalPresentationStyle{
return UIModalPresentationStyleFullScreen;
}
Here is an easy solution without coding a single line.
This change makes iPad app behavior as expected otherwise the new screen is displaying in the center of the screen as a popup.