Skip to content

Instantly share code, notes, and snippets.

@CocoaRush
Forked from Marlunes/hide_status_bar
Last active December 21, 2015 20:29
Show Gist options
  • Save CocoaRush/6361233 to your computer and use it in GitHub Desktop.
Save CocoaRush/6361233 to your computer and use it in GitHub Desktop.
hide status bar on iOS 7, add this snippet on the root view controller.
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view from its nib.
if ([self respondsToSelector:SELE(setNeedsStatusBarAppearanceUpdate)]) { //iOS 7
[self setNeedsStatusBarAppearanceUpdate];
} else {
[[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationFade];
}
}
// overwrite this Method
- (BOOL)prefersStatusBarHidden
{
return YES;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment