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
Quick solution. There are already really great answers above. I am also adding my quick 2 points input, which is presented in the screenshot.
If you are not using Navigation Controller
then from Right Menu Inspector
set the Presentation to Full Screen
If you are using Navigation Controller
then by default it will present full screen, you have to do nothing.
This worked for me
`let vc = self.storyboard?.instantiateViewController(withIdentifier: "cameraview1") as! CameraViewController
vc.modalPresentationStyle = .fullScreen
self.present(vc, animated: true, completion: nil)`
class MyViewController: UIViewController {
convenience init() {
self.init(nibName:nil, bundle:nil)
self.modalPresentationStyle = .fullScreen
}
override func viewDidLoad() {
super.viewDidLoad()
}
}
Rather than call self.modalPresentationStyle = .fullScreen
for every view controller, you can subclass UIViewController and just use MyViewController
everywhere.
All the other answers are sufficient but for a large project like ours and where navigations are being made both in code and storyboard, it is quite a daunting task.
For those who are actively using Storyboard. This is my advice: use Regex.
The following format is not good for full screen pages:
<segue destination="Bof-iQ-svK" kind="presentation" identifier="importSystem" modalPresentationStyle="fullScreen" id="bfy-FP-mlc"/>
The following format is good for full screen pages:
<segue destination="7DQ-Kj-yFD" kind="presentation" identifier="defaultLandingToSystemInfo" modalPresentationStyle="fullScreen" id="Mjn-t2-yxe"/>
The following regex compatible with VS CODE will convert all Old Style pages to new style pages. You may need to escape special chars if you're using other regex engines/text editors.
Search Regex
<segue destination="(.*)"\s* kind="show" identifier="(.*)" id="(.*)"/>
Replace Regex
<segue destination="$1" kind="presentation" identifier="$2" modalPresentationStyle="fullScreen" id="$3"/>
For Objective-C users
Just Use this code
[vc setModalPresentationStyle: UIModalPresentationFullScreen];
Or if you want to add it particular in iOS 13.0 then use
if (@available(iOS 13.0, *)) {
[vc setModalPresentationStyle: UIModalPresentationFullScreen];
} else {
// Fallback on earlier versions
}
This worked for me:
yourViewController.modalPresentationStyle = UIModalPresentationStyle.fullScreen