Created
October 25, 2013 23:42
-
-
Save priore/7163501 to your computer and use it in GitHub Desktop.
How to manage the image asynchronously from a UIImagePicker
This file contains hidden or 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
| // How to manage the image asynchronously from a UIImagePickerController | |
| - (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info | |
| { | |
| // hide UIImagePickerController | |
| [picker dismissViewControllerAnimated:YES completion:^{ | |
| dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 1 * NSEC_PER_SEC), dispatch_get_current_queue(), ^{ | |
| dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_LOW, 0), ^{ | |
| UIImage *originalImage = [info objectForKey:UIImagePickerControllerOriginalImage]; | |
| if (photo) { | |
| // TODO: you code here.... | |
| } | |
| }); | |
| }); | |
| }]; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment