Completing documentation of AFImageRequestOperation

This commit is contained in:
Mattt Thompson 2011-09-21 23:34:05 -05:00
parent 4cb29d24ad
commit d67db7172a
2 changed files with 26 additions and 0 deletions

View file

@ -24,11 +24,34 @@
#import <UIKit/UIKit.h>
#import "AFHTTPRequestOperation.h"
/**
`AFImageRequestOperation` is an `NSOperation` that wraps the callback from `AFHTTPRequestOperation` to create an image from the response body, and optionally cache the image to memory.
@see NSOperation
@see AFHTTPRequestOperation
*/
@interface AFImageRequestOperation : AFHTTPRequestOperation
/**
Creates and returns an `AFImageRequestOperation` object and sets the specified success callback.
@param urlRequest The request object to be loaded asynchronously during execution of the operation.
@param success A block object to be executed when the request finishes successfully, with a status code in the 2xx range, and with an acceptable content types (e.g. `image/png`). This block has no return value and takes a single arguments, the image created from the response data of the request.
@return A new image request operation
*/
+ (AFImageRequestOperation *)operationWithRequest:(NSURLRequest *)urlRequest
success:(void (^)(UIImage *image))success;
/**
Creates and returns an `AFImageRequestOperation` object and sets the specified success callback.
@param urlRequest The request object to be loaded asynchronously during execution of the operation.
@param success A block object to be executed when the request finishes successfully, with a status code in the 2xx range, and with an acceptable content types (e.g. `image/png`). This block has no return value and takes a three arguments: the request object of the operation, the response for the request, and the image created from the response data.
@param success A block object to be executed when the request finishes unsuccessfully. This block has no return value and takes a three arguments: the request object of the operation, the response for the request, and the error associated with the cause for the unsuccessful operation.
@return A new image request operation
*/
+ (AFImageRequestOperation *)operationWithRequest:(NSURLRequest *)urlRequest
imageProcessingBlock:(UIImage *(^)(UIImage *))imageProcessingBlock
cacheName:(NSString *)cacheNameOrNil

View file

@ -25,6 +25,9 @@
/**
`AFJSONRequestOperation` is an `NSOperation` that wraps the callback from `AFHTTPRequestOperation` to determine the success or failure of a request based on its status code and response content type, and parse the response body into a JSON object.
@see NSOperation
@see AFHTTPRequestOperation
*/
@interface AFJSONRequestOperation : AFHTTPRequestOperation