Closed tsilva closed 9 years ago
AFNetworking
supports using an AFImageResponseSerializer
as the response serializer. This makes is so that the response is already returned as an UIImage. This is not very worthwhile because creating and image from NSData is very simple (eg: UIImageJPEGRepresentation(topImage, 1.0)
). So probably what makes sense here is being able to retrieve raw data and let the developer parse the response himself.
HMProxyRequest
should work with any type of data, but yes a proper specialized class should be created to retrieva an UIImage directly
Simple dummy usage, note that the proxy is allocated inline (a global static one should be used instead)
self.proxy = [[HMProxy alloc] init];
[self.imageView setImageWithURLString:@"http://httpbin.org/image/png" proxy:self.proxy];
The only types of request I have available are
HMJsonRequest
andHMProxyRequest
, and neither of these work for retrieving an image.