Follow the below steps
1.In yourproject - info.plist
Status bar is initially hidden Boolean YES
2.After that you need to do is in didFinishLaunchingWithOptions of AppDelegate.m
[UIApplication sharedApplication].statusBarHidden=NO;
if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7)
{
[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleDefault];
[application setStatusBarHidden:NO];
self.window.clipsToBounds=YES;
self.window.frame = CGRectMake(0,20,self.window.frame.size.width,self.window.frame.size.height-20);
}
else
{
self.window=[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
[UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleLightContent;
[application setStatusBarHidden:NO];
self.window.clipsToBounds=YES;
self.window.frame = CGRectMake(0,20,self.window.frame.size.width,self.window.frame.size.height-20);
}
If you follow the above steps, you don't need to write the code in viewWillAppear of every view controller.