Last active
September 16, 2015 16:03
-
-
Save g-1/4f1555846a3f94943ad8 to your computer and use it in GitHub Desktop.
UIImagePickerControllerをStoryBoardで表現することがiOS8で出来なくなった。 ref: http://qiita.com/g-1/items/897fb01f43eaab66223e
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
- (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