Last active
March 3, 2016 12:42
-
-
Save NeuralGlue/6907596 to your computer and use it in GitHub Desktop.
Category to hide the status bar for a UIImagePickerController in IOS 7+
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// UIImagePickerController+RemoveStatusBar.m | |
// CarpeWorkshop | |
// With thanks to:http://stackoverflow.com/users/2797041/user2797041 | |
// Created by Charles Young on 10/9/13. | |
// Copyright (c) 2013 Charles Young. All rights reserved. | |
// | |
#import "UIImagePickerController+RemoveStatusBar.h" | |
@implementation UIImagePickerController (RemoveStatusBar) | |
- (void)viewDidLoad | |
{ | |
[super viewDidLoad]; | |
// not an issue before IOS7 (likely to be fixed after too... | |
if (floor(NSFoundationVersionNumber) > NSFoundationVersionNumber_iOS_6_1) | |
{ | |
self.edgesForExtendedLayout = UIRectEdgeNone; | |
[self prefersStatusBarHidden]; | |
[self performSelector:@selector(setNeedsStatusBarAppearanceUpdate)]; | |
} | |
} | |
- (BOOL)prefersStatusBarHidden | |
{ | |
return YES; | |
} | |
- (UIViewController *)childViewControllerForStatusBarHidden | |
{ | |
return nil; | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment