Skip to content

Instantly share code, notes, and snippets.

@g-1
Last active September 16, 2015 16:03
Show Gist options
  • Save g-1/4f1555846a3f94943ad8 to your computer and use it in GitHub Desktop.
Save g-1/4f1555846a3f94943ad8 to your computer and use it in GitHub Desktop.
UIImagePickerControllerをStoryBoardで表現することがiOS8で出来なくなった。 ref: http://qiita.com/g-1/items/897fb01f43eaab66223e
- (void)doImagePickerController
{
UIImagePickerController* imagePicker = [[UIImagePickerController alloc] init];
imagePicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
imagePicker.allowsEditing = NO;
imagePicker.delegate = self;
[[NSOperationQueue mainQueue] addOperationWithBlock:^{
[self presentViewController:imagePicker animated:YES completion:nil];
}];
}
#pragma mark <UIImagePickerControllerDelegate>
- (void)imagePickerController:(UIImagePickerController *)picker
didFinishPickingMediaWithInfo:(NSDictionary *)info {
[self dismissViewControllerAnimated:YES completion:nil];
//TODO:
}
- (void)imagePickerControllerDidCancel:(UIImagePickerController *)picker{
[self dismissViewControllerAnimated:YES completion:nil];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment