KWUserDefinedMatcherMessageBlock Block Reference
| Declared in | KWUserDefinedMatcher.h |
|---|
Block Definition
KWUserDefinedMatcherMessageBlock
typedef NSString* (^KWUserDefinedMatcherMessageBlock) (id )
| Conforms to | NSCopying NSObject NSSecureCoding |
|---|---|
| Declared in | AFURLResponseSerialization.h |
The AFURLResponseSerialization protocol is adopted by an object that decodes data into a more useful object representation, according to details in the server response. Response serializers may additionally perform validation on the incoming response and data.
For example, a JSON response serializer may check for an acceptable status code (2XX range) and content type (application/json), decoding a valid JSON response into an object.
– responseObjectForResponse:data:error:
required method- (nullable id)responseObjectForResponse:(nullable NSURLResponse *)response data:(nullable NSData *)data error:(NSError *_Nullable __autoreleasing *)errorAFURLResponseSerialization.h
| Conforms to | NSCopying NSObject NSSecureCoding |
|---|---|
| Declared in | AFURLRequestSerialization.h |
The AFURLRequestSerialization protocol is adopted by an object that encodes parameters for a specified HTTP requests. Request serializers may encode parameters as query strings, HTTP bodies, setting the appropriate HTTP header fields as necessary.
For example, a JSON request serializer may set the HTTP body of the request to a JSON representation, and set the Content-Type HTTP header field value to application/json.
– requestBySerializingRequest:withParameters:error:
required methodReturns a request with the specified parameters encoded into a copy of the original request.
- (nullable NSURLRequest *)requestBySerializingRequest:(NSURLRequest *)request withParameters:(nullable id)parameters error:(NSError *_Nullable __autoreleasing *)errorrequest |
The original request. |
|---|---|
parameters |
The parameters to be encoded. |
error |
The error that occurred while attempting to encode the request parameters. |
A serialized request.
AFURLRequestSerialization.h
| Declared in | UIProgressView+AFNetworking.h UIProgressView+AFNetworking.m |
|---|
This category adds methods to the UIKit framework’s UIProgressView class. The methods in this category provide support for binding the progress to the upload and download progress of a session task.
– setProgressWithUploadProgressOfTask:animated:
Binds the progress to the upload progress of the specified session task.
- (void)setProgressWithUploadProgressOfTask:(NSURLSessionUploadTask *)task animated:(BOOL)animatedtask |
The session task. |
|---|---|
animated |
|
UIProgressView+AFNetworking.h
– setProgressWithDownloadProgressOfTask:animated:
Binds the progress to the download progress of the specified session task.
- (void)setProgressWithDownloadProgressOfTask:(NSURLSessionDownloadTask *)task animated:(BOOL)animatedtask |
The session task. |
|---|---|
animated |
|
UIProgressView+AFNetworking.h
| Declared in | UIImageView+AFNetworking.h UIImageView+AFNetworking.m |
|---|
This category adds methods to the UIKit framework’s UIImageView class. The methods in this category provide support for loading remote images asynchronously from a URL.
+ setSharedImageDownloader:
Set the shared image downloader used to download images.
+ (void)setSharedImageDownloader:(AFImageDownloader *)imageDownloaderimageDownloader |
The shared image downloader used to download images. |
|---|
UIImageView+AFNetworking.h
+ sharedImageDownloader
The shared image downloader used to download images.
+ (AFImageDownloader *)sharedImageDownloaderUIImageView+AFNetworking.h
– setImageWithURL:
Asynchronously downloads an image from the specified URL, and sets it once the request is finished. Any previous image request for the receiver will be cancelled.
- (void)setImageWithURL:(NSURL *)urlurl |
The URL used for the image request. |
|---|
If the image is cached locally, the image is set immediately, otherwise the specified placeholder image will be set immediately, and then the remote image will be set once the request is finished.
By default, URL requests have a Accept header field value of “image / *”, a cache policy of NSURLCacheStorageAllowed and a timeout interval of 30 seconds, and are set not handle cookies. To configure URL requests differently, use setImageWithURLRequest:placeholderImage:success:failure:
UIImageView+AFNetworking.h
– setImageWithURL:placeholderImage:
Asynchronously downloads an image from the specified URL, and sets it once the request is finished. Any previous image request for the receiver will be cancelled.
- (void)setImageWithURL:(NSURL *)url placeholderImage:(nullable UIImage *)placeholderImageurl |
The URL used for the image request. |
|---|---|
placeholderImage |
The image to be set initially, until the image request finishes. If |
If the image is cached locally, the image is set immediately, otherwise the specified placeholder image will be set immediately, and then the remote image will be set once the request is finished.
By default, URL requests have a Accept header field value of “image / *”, a cache policy of NSURLCacheStorageAllowed and a timeout interval of 30 seconds, and are set not handle cookies. To configure URL requests differently, use setImageWithURLRequest:placeholderImage:success:failure:
UIImageView+AFNetworking.h
– setImageWithURLRequest:placeholderImage:success:failure:
Asynchronously downloads an image from the specified URL request, and sets it once the request is finished. Any previous image request for the receiver will be cancelled.
- (void)setImageWithURLRequest:(NSURLRequest *)urlRequest placeholderImage:(nullable UIImage *)placeholderImage success:(nullable void ( ^ ) ( NSURLRequest *request , NSHTTPURLResponse *_Nullable response , UIImage *image ))success failure:(nullable void ( ^ ) ( NSURLRequest *request , NSHTTPURLResponse *_Nullable response , NSError *error ))failureurlRequest |
The URL request used for the image request. |
|---|---|
placeholderImage |
The image to be set initially, until the image request finishes. If |
success |
A block to be executed when the image data task finishes successfully. This block has no return value and takes three arguments: the request sent from the client, the response received from the server, and the image created from the response data of request. If the image was returned from cache, the response parameter will be |
failure |
A block object to be executed when the image data task finishes unsuccessfully, or that finishes successfully. This block has no return value and takes three arguments: the request sent from the client, the response received from the server, and the error object describing the network or parsing error that occurred. |
If the image is cached locally, the image is set immediately, otherwise the specified placeholder image will be set immediately, and then the remote image will be set once the request is finished.
If a success block is specified, it is the responsibility of the block to set the image of the image view before returning. If no success block is specified, the default behavior of setting the image with self.image = image is applied.
UIImageView+AFNetworking.h
– cancelImageDownloadTask
Cancels any executing image operation for the receiver, if one exists.
- (void)cancelImageDownloadTaskUIImageView+AFNetworking.h
| Declared in | UIRefreshControl+AFNetworking.h UIRefreshControl+AFNetworking.m |
|---|
This category adds methods to the UIKit framework’s UIRefreshControl class. The methods in this category provide support for automatically beginning and ending refreshing depending on the loading state of a session task.
– setRefreshingWithStateOfTask:
Binds the refreshing state to the state of the specified task.
- (void)setRefreshingWithStateOfTask:(NSURLSessionTask *)tasktask |
The task. If |
|---|
UIRefreshControl+AFNetworking.h
| Declared in | AFURLRequestSerialization.h |
|---|
typedef NS_ENUM(NSUInteger, AFHTTPRequestQueryStringSerializationStyle ) {
AFHTTPRequestQueryStringDefaultStyle = 0,
};
AFURLRequestSerialization.h