// encode image on background thread
                           dispatch_async(dispatch_get_global_queue(QOS_CLASS_BACKGROUND, 0), ^{
                               NSData *imageData = result.namedArguments[@"image_data"];
                               UIImage *image = [UIImage imageWithData:imageData];

                               // callback on main thread
                               dispatch_async(dispatch_get_main_queue(), ^{
                                   callback(image, nil);
                               });
Advertisements