Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ViewController - Fullscreen

Tags:

ios

swift

The second ViewController has this space on top and it almost shows up as a dismissable-popup on the phone. How to make is full screen (remove the space pointed with the Orange arrow)?

enter image description here

like image 523
Anand Rockzz Avatar asked Sep 23 '19 10:09

Anand Rockzz


1 Answers

This is an iOS 13 change. Users will start to expect to be able to swipe away modals so it might be worth looking into supporting that.

If you're really set on using the old presentation style you can do so by setting the modalPresentationStyle of the presented viewController either before presenting:

vc.modalPresentationStyle = .fullScreen

or override it in the view controller itself:

override var modalPresentationStyle: UIModalPresentationStyle {
    get { .fullScreen }
    set { assertionFailure("Shouldnt change that 😠") }
}

or set in in the storyboard segue:

storyboard segue example

like image 52
Casper Zandbergen Avatar answered Nov 08 '22 20:11

Casper Zandbergen