Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- NSURLSessionDownloadTask *getImageTask = [session downloadTaskWithURL:[NSURL URLWithString:imageUrl]
- completionHandler:^(NSURL *location, NSURLResponse *response, NSError *error) {
- // Here you use the location variable provided in the completion handler to get a pointer to the image
- UIImage *downloadedImage = [UIImage imageWithData:[NSData dataWithContentsOfURL:location]];
- // Finally you could, for example, update UIImageView’s image to show the new file.
- dispatch_async(dispatch_get_main_queue(), ^{
- // do stuff with image
- _imageWithBlock.image = downloadedImage;
- });
- }];
Add Comment
Please, Sign In to add comment