How to hide the status bar programmatically in iOS 8
12,515
You should add this key/value pair to your project's Info.plist.
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
After that,calling
UIApplication.sharedApplication().statusBarHidden = true
or
UIApplication.sharedApplication().setStatusBarHidden(true, withAnimation: .Fade) // with animation option.
This post gives more details > How to hide iOS status bar
Author by
Jason Oviedo
Updated on June 04, 2022Comments
-
Jason Oviedo almost 2 years
Just like the question says, I need to hide status + navigation bar when user taps. So far, navigation bar was easy. Cann't find a way to do the same with status bar.
By the way, tried
UIApplication.sharedApplication().statusBarHidden = true
but no luck yet
-
Oleg Popov over 8 yearsi would like just to tell you Thanks!
-
Codetard about 8 yearsit's deprecated in iOS 9
-
Greg about 8 years@SatnamSync if you look at the date this answer was posted, you'll notice that iOS 9 was not yet released at that time. If you have a better answer, please feel free to answer this question yourself.