Добавить следующие строки в viewDidLoad:
[[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationFade];
и добавить новый метод
- (BOOL)prefersStatusBarHidden {
return YES;
}
также изменить файл info.plist
View controller-based status bar appearance" = NO
А также добавить условие для iPhone 6 и 6 Plus.Here являются методы для iPhone 6 и 6 Plus:
/*=====================================================================================================================
Checks if the device has 4.7 inch screen such as iPhone6 generation
=====================================================================================================================*/
+(BOOL) ISiPhone6
{
BOOL isIpad = ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad);
CGRect screenRect = [[UIScreen mainScreen] bounds];
// we need to check the maximum of width and height because some screens (the camera view while scanning) we can
// rotate to portrait or landscape and in the case the screen height and width flip
return (!isIpad && MAX(screenRect.size.height,screenRect.size.width) == 667);
}
/*=====================================================================================================================
Checks if the device has 5.5 inch screen such as iPhone6 plus
=====================================================================================================================*/
+(BOOL) ISiPhone6Plus
{
BOOL isIpad = ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad);
CGRect screenRect = [[UIScreen mainScreen] bounds];
// we need to check the maximum of width and height because some screens (the camera view while scanning) we can
// rotate to portrait or landscape and in the case the screen height and width flip
return (!isIpad && MAX(screenRect.size.height,screenRect.size.width) == 736);
}
это работает для меня.