In iOS apps when we need to hide control center appears in iPhone device on swipe up gesture or forced to hide UIStatusBar then use below code.
Write below lines in your viewDidLoad method.
if ([self respondsToSelector:@selector(setNeedsStatusBarAppearanceUpdate)]) {
[self prefersStatusBarHidden];
[self performSelector:@selector(setNeedsStatusBarAppearanceUpdate)];
} else {
[[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationSlide];
}
- (BOOL)prefersStatusBarHidden
{
return YES;
}
Hope it will help.
Happy Coding!!!
0 Comment(s)