In iOS7, there's actually a new property for UIViewController called modalPresentationCapturesStatusBarAppearance
. Apple iOS reference.
Default value is NO.
When you present a view controller by calling the presentViewController:animated:completion: method, status bar appearance control is transferred from the presenting to the presented view controller only if the presented controller’s modalPresentationStyle value is UIModalPresentationFullScreen. By setting this property to YES, you specify the presented view controller controls status bar appearance, even though presented non–fullscreen.
The system ignores this property’s value for a view controller presented fullscreen.
Therefore, for any presentationStyle other than the normal fullscreen (for example: UIModalPresentationCustom), this must be set if you want to capture the status bar. To use, all you have to do is set it to YES
on the view controller that's being presented:
toVC.modalPresentationCapturesStatusBarAppearance = YES;