AFImageResponseSerializer Class Reference
Inherits from | AFHTTPResponseSerializer : NSObject |
Declared in | AFURLResponseSerialization.h AFURLResponseSerialization.m |
Overview
AFImageSerializer
is a subclass of AFHTTPResponseSerializer
that validates and decodes image responses.
By default, AFImageSerializer
accepts the following MIME types, which correspond to the image formats supported by UIImage or NSImage:
image/tiff
image/jpeg
image/gif
image/png
image/ico
image/x-icon
image/bmp
image/x-bmp
image/x-xbitmap
image/x-win-bitmap
Properties
automaticallyInflatesResponseImage
Whether to automatically inflate response image data for compressed formats (such as PNG or JPEG). Enabling this can significantly improve drawing performance on iOS when used with setCompletionBlockWithSuccess:failure:
, as it allows a bitmap representation to be constructed in the background rather than on the main thread. YES
by default.
@property (nonatomic, assign) BOOL automaticallyInflatesResponseImage
Declared In
AFURLResponseSerialization.h
imageScale
The scale factor used when interpreting the image data to construct responseImage
. Specifying a scale factor of 1.0 results in an image whose size matches the pixel-based dimensions of the image. Applying a different scale factor changes the size of the image as reported by the size property. This is set to the value of scale of the main screen by default, which automatically scales images for retina displays, for instance.
@property (nonatomic, assign) CGFloat imageScale
Declared In
AFURLResponseSerialization.h