Thursday, November 17, 2016

Hide status bar

In Swift 3, to hide the status bar, simply add the following to your view controller.
override var prefersStatusBarHidden: Bool {  
    return true  
}  

However, sometimes you might just want to do it in a completion block, or within some animation block. In that case, add
UIApplication.shared.isStatusBarHidden = true
And toggle off when desired

No comments:

Post a Comment