iosswiftios13xcode11.3

iOS: 13 - remove space between status bar and scrollview


Recently, I Updated my Xcode from 10.1 to 11.3, and I noticed that some of the features were change, when I ran my app on an Simulator with iOS 13, I saw that the there is a space between the status bar and the scrollview I used for the main page, please see attached images:

https://i.sstatic.net/uoFE7.png

https://i.sstatic.net/Rb0FV.png

How to fix?


Solution

  • Consider Roberto's answer if you can push view controllers. If using present:

    Storyboard solution:

    If you still want to use present, then change segue presentation to Full Screen in the storyboard.

    enter image description here

    Programmatically:

    let vc = UIStoryboard(name: "Main", bundle: Bundle.main).instantiateViewController(withIdentifier: "yourVC") as! YourVC
        vc.modalPresentationStyle = .fullScreen // add this
        self.present(vc, animated: true, completion: nil)