I am building my app on iOS 8 and getting problem with status bar visibility when UIViewController is presented with modalPresentationStyle = UIModalPresentationPageSheet. I read the documentation that new API true value of "modalPresentationCapturesStatusBarAppearance" used to hide status bar when modal presentation is presented, but I am getting no result with this in this modalPresentationStyle. In my application I am not showing status bar. It was working fine with this style in iOS 7 but when it comes to iOS 8 it is giving problem. Here is my code:
UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:viewController];
nav.modalPresentationStyle = UIModalPresentationPageSheet;
nav.modalTransitionStyle=UIModalTransitionStyleCoverVertical;
nav.modalPresentationCapturesStatusBarAppearance = YES; // To hide status bar, doest work with UIModalPresentationPageSheet style
[self.navigationController presentViewController:nav animated:YES completion:NULL];
I am getting like this:
But the desired output is
Please help !!