diff --git a/AFNetworking/AFImageRequestOperation.h b/AFNetworking/AFImageRequestOperation.h index 180c653..2c95678 100644 --- a/AFNetworking/AFImageRequestOperation.h +++ b/AFNetworking/AFImageRequestOperation.h @@ -24,11 +24,34 @@ #import #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 diff --git a/AFNetworking/AFJSONRequestOperation.h b/AFNetworking/AFJSONRequestOperation.h index 00fc2b6..057defd 100644 --- a/AFNetworking/AFJSONRequestOperation.h +++ b/AFNetworking/AFJSONRequestOperation.h @@ -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