Skip to content

Instantly share code, notes, and snippets.

@danielphillips
Forked from ddeville/gist:5670475
Last active December 17, 2015 22:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danielphillips/5682765 to your computer and use it in GitHub Desktop.
Save danielphillips/5682765 to your computer and use it in GitHub Desktop.
@interface SomeViewController : UIViewController
@end
@implementation SomeViewController
- (IBAction)show:(id)sender
{
UIImagePickerController *pickerController = [UIImagePickerController new];
[pickerController setDelegate:(id)self];
[self presentViewController:pickerController animated:YES completion:nil];
}
#pragma mark image picker hacks
- (void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated
{
if(![navigationController isKindOfClass:[UIImagePickerController class]])
return;
UINavigationItem *item = [viewController navigationItem];
if(!item.rightBarButtonItems){
[item setValue:nil forKey:@"_customRightViews"];
}else{
[item setRightBarButtonItems:nil];
}
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment