SHARE
TWEET

How to manage the image asynchronously from a UIImagePicker

priore Jun 10th, 2013 487 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // How to manage the image asynchronously from a UIImagePickerController
  2. - (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
  3. {
  4.         // hide UIImagePickerController
  5.         [picker dismissViewControllerAnimated:YES completion:^{
  6.                 dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 1 * NSEC_PER_SEC), dispatch_get_current_queue(), ^{
  7.                         dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_LOW, 0), ^{
  8.                                     UIImage *originalImage = [info objectForKey:UIImagePickerControllerOriginalImage];
  9.            
  10.                         if (photo) {
  11.                        
  12.                                 // TODO: you code here....
  13.                             }
  14.                         });
  15.                 });                                  
  16.         }];
  17. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top