Note: in iOS 8, Status bar hides itself automatically in landscape and comes back in portrait(iPhone only).
To show videos in my app, I am using XCDYouTubeKit, which is a light wrapper on MPMoviePlayerViewController.
I had to set "View controller-based status bar appearance" in info.plist file to "NO" in my app due to some functionality. The app works fine till you don't use XCDYouTubeKit(MPMoviePlayerViewController). After using XCDYouTubeKit the app loses the functionality specified in "Note" above means status bar starts showing up in landscape also.
You can download the demo project here.
https://www.dropbox.com/s/yp5pkvf9evsl8wb/XCDYouTubeKit%20Demo.zip?dl=0
To experience this thing you need to follow the following steps in XCDYouTubeKit demo:
Please help!!!
Note too, Harsh, you can (controversially!) just use a category for that!
only once for the whole app. We do his every single time in high-volume production apps (in the objective-c era) with no problem, and I see it constantly in high-volume client projects. ... So ..
1) make a category called exactly UIViewController+HideStatusBar
@interface UIViewController (HideStatusBar)
@end
// the only practical approach for no-statusbar in iOS7,8+
@implementation UIViewController (HideStatusBar)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wobjc-protocol-method-implementation"
-(BOOL)prefersStatusBarHidden {return YES;}
-(UIViewController *)childViewControllerForStatusBarHidden {return nil;}
#pragma clang diagnostic pop
@end
2) in your plist add
<key>UIStatusBarHidden~ipad</key>
<true/>
// that is needed if you're covering iPad; do it always for consistency
3) Do not set "Status bar is initially hidden" to "YES" in your plist.
4) Do not alter UIViewControllerBasedStatusBarAppearance.
Extended discussion.