AFNetworking 2.0 – How to download uiimage async

Solutions Collect From Internet About “AFNetworking 2.0 – How to download uiimage async”

You can do

AFHTTPRequestOperation *requestOperation = [[AFHTTPRequestOperation alloc] initWithRequest:urlRequest];
requestOperation.responseSerializer = [AFImageResponseSerializer serializer];
[requestOperation setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, id responseObject) {
    NSLog(@"Response: %@", responseObject);
    _imageView.image = responseObject;

} failure:^(AFHTTPRequestOperation *operation, NSError *error) {
    NSLog(@"Image error: %@", error);
}];
[requestOperation start];

also mentioned How to download image with AFNetworking 2.0?