iPhone Development:Hide statusBar Programmatically in iPhone SDK

Every smartphone device has a status bar at top of the screen displaying signal strength,battery status,carrier name etc. In some of our application, we had to hide the status bar.
To  hide Status Bar  programatically, one can use the given below code snippet
[[UIApplication sharedApplication] setStatusBarHidden:YES animated:NO];
Note:- This will only work if device is running on IOS 6.With IOS 7 you have to make 2 more changes to hide status bar in every screen/viewController of your application.

Follow the below given steps to hide status bar in iOS 7.

  • Go to info.plist and add two attributes:
  •  set “Status bar is initially hidden” to “YES” 
  •  set “UIViewControllerBasedStatusBarAppearance” to “NO”. 

This will hide status bar for your application.