Created
December 10, 2015 03:31
-
-
Save phucnm/4607206f16ad30bffc3c to your computer and use it in GitHub Desktop.
Present UIImagePickerController (or any UIViewController) in iOS9 or later because of deprecated UIPopOverController
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)presentImagePicker:(UIView *)sender { | |
UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init]; | |
imagePicker.modalPresentationStyle = UIModalPresentationPopover; | |
imagePicker.popoverPresentationController.sourceView = sender; | |
imagePicker.popoverPresentationController.permittedArrowDirections = UIPopoverArrowDirectionAny; | |
[self presentViewController:imagePicker animated:YES completion:nil]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment