Baixar imagem

É um snippet fácil para baixar imagens da web

NSString *imageUrl = @"http://someHost.com/image.jpg";
NSURLSessionConfiguration *sessionConfig = [NSURLSessionConfiguration defaultSessionConfiguration];
NSURLSession *session =
[NSURLSession sessionWithConfiguration:sessionConfig
delegate:self delegateQueue:nil];
NSURLSessionDownloadTask *getImageTask =
[session downloadTaskWithURL:[NSURL URLWithString:imageUrl]
completionHandler
:^(NSURL *location, NSURLResponse *response,
NSError *error) {

downloadedImage
= [UIImage imageWithData:
[NSData dataWithContentsOfURL:location]];
dispatch_async
(dispatch_get_main_queue(), ^{ // do stuff with
//_image is an imageVIew
_image
.image = downloadedImage;
}); }];
[getImageTask resume];