Skip to content

Instantly share code, notes, and snippets.

@NeuralGlue
Last active March 3, 2016 12:42
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NeuralGlue/6907596 to your computer and use it in GitHub Desktop.
Save NeuralGlue/6907596 to your computer and use it in GitHub Desktop.
Category to hide the status bar for a UIImagePickerController in IOS 7+
//
// 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