For iOS6 and below, we used to write a line of code in didFinishLaunchingWithOptions:
as
[UIApplication sharedApplication].statusBarHidden = YES;
However you have to be careful in some events like if you are accessing photo library of your camera. In that screen, status bar will appear. Interestingly, after the screen containing the photo library is dismissed, the status bar appears again. So inside the view controller of the first screen after the photo library screen is dismissed, you have to write that piece of code again.
For iOS7, the procedure has changed. You have to set it in info.plist
of your application. If you are having multiple targets for the same app, for each of the info.plist
, you have to set the key of View controller-based status bar appearance
as NO
. Just to easily remember the key name, alphabetically, it is the last key in friendly key-value format.
Using XIB, you can't hide the status bar. However for visualization purpose, when you are designing the screen, you can hide it or show it.
Hope this answer helps you.