Objective-C Tips & Trick - Prioregroup.com
[Objective-C] How to manage the image asynchronously from a UIImagePicker
       
back

// 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....
		            }
        		});
    		});                                   
    	}];
}






Copyright © 1996-2018 Centro Studi Informatica di Danilo Priore. All rights reserved. P.I.10149810581.
prioregroup.com