Tutorial – Hide Status Bar Programmatically
Hiding the status bar in iOS using Swift is easy with one line of code. Simply insert the following line of code into your view controller:
override var prefersStatusBarHidden: Bool { return true }
And then run your app, the status bar will now be hidden in the class you put this code in! You can see below the results of this line of code.
From this:
To This: