Created
June 15, 2013 08:20
-
-
Save danmartyn/5787380 to your computer and use it in GitHub Desktop.
Image Library
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 *libraryController = [[UIImagePickerController alloc] init]; | |
libraryController.delegate = self; | |
libraryController.sourceType = UIImagePickerControllerSourceTypePhotoLibrary; | |
libraryController.allowsEditing = YES; | |
// if on the ipad, show the library in a popover | |
if (iPad) | |
{ | |
UIPopoverController *libraryPopover = [[UIPopoverController alloc] initWithContentViewController:libraryController]; | |
[libraryPopover presentPopoverFromRect:self.rectToPresentPopoverFrom inView:self.scrollView permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES]; | |
self.popover = libraryPopover; | |
} else | |
{ | |
[self presentViewController:libraryController animated:YES completion:nil]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment