KWUserDefinedMatcherBlock Block Reference

KWUserDefinedMatcherBlock Block Reference

Declared in KWUserDefinedMatcher.h

Block Definition

KWUserDefinedMatcherBlock

typedef BOOL (^KWUserDefinedMatcherBlock) ()
KWUserDefinedMatcherMessageBlock Block Reference

KWUserDefinedMatcherMessageBlock Block Reference

Declared in KWUserDefinedMatcher.h

Block Definition

KWUserDefinedMatcherMessageBlock

typedef NSString* (^KWUserDefinedMatcherMessageBlock) (id )
AFURLResponseSerialization Protocol Reference

AFURLResponseSerialization Protocol Reference

Conforms to NSCopying
NSObject
NSSecureCoding
Declared in AFURLResponseSerialization.h

Overview

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 *)error

Declared In

AFURLResponseSerialization.h

PostedNotificationBlock Block Reference

PostedNotificationBlock Block Reference

Declared in KWNotificationMatcher.h

Block Definition

PostedNotificationBlock

typedef void (^PostedNotificationBlock) (NSNotification *note)
AFURLRequestSerialization Protocol Reference

AFURLRequestSerialization Protocol Reference

Conforms to NSCopying
NSObject
NSSecureCoding
Declared in AFURLRequestSerialization.h

Overview

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 method

Returns 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 *)error

Parameters

request

The original request.

parameters

The parameters to be encoded.

error

The error that occurred while attempting to encode the request parameters.

Return Value

A serialized request.

Declared In

AFURLRequestSerialization.h

UIProgressView(AFNetworking) Category Reference

UIProgressView(AFNetworking) Category Reference

Declared in UIProgressView+AFNetworking.h
UIProgressView+AFNetworking.m

Overview

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.

Setting Session Task Progress

– setProgressWithUploadProgressOfTask:animated:

Binds the progress to the upload progress of the specified session task.

- (void)setProgressWithUploadProgressOfTask:(NSURLSessionUploadTask *)task animated:(BOOL)animated

Parameters

task

The session task.

animated

YES if the change should be animated, NO if the change should happen immediately.

Declared In

UIProgressView+AFNetworking.h

– setProgressWithDownloadProgressOfTask:animated:

Binds the progress to the download progress of the specified session task.

- (void)setProgressWithDownloadProgressOfTask:(NSURLSessionDownloadTask *)task animated:(BOOL)animated

Parameters

task

The session task.

animated

YES if the change should be animated, NO if the change should happen immediately.

Declared In

UIProgressView+AFNetworking.h

UIImageView(AFNetworking) Category Reference

UIImageView(AFNetworking) Category Reference

Declared in UIImageView+AFNetworking.h
UIImageView+AFNetworking.m

Overview

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.

Accessing the Image Downloader

+ setSharedImageDownloader:

Set the shared image downloader used to download images.

+ (void)setSharedImageDownloader:(AFImageDownloader *)imageDownloader

Parameters

imageDownloader

The shared image downloader used to download images.

Declared In

UIImageView+AFNetworking.h

+ sharedImageDownloader

The shared image downloader used to download images.

+ (AFImageDownloader *)sharedImageDownloader

Declared In

UIImageView+AFNetworking.h

Setting Image

– 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 *)url

Parameters

url

The URL used for the image request.

Discussion

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:

Declared In

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 *)placeholderImage

Parameters

url

The URL used for the image request.

placeholderImage

The image to be set initially, until the image request finishes. If nil, the image view will not change its image until the image request finishes.

Discussion

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:

Declared In

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 ))failure

Parameters

urlRequest

The URL request used for the image request.

placeholderImage

The image to be set initially, until the image request finishes. If nil, the image view will not change its image until the image request finishes.

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 nil.

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.

Discussion

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.

Declared In

UIImageView+AFNetworking.h

– cancelImageDownloadTask

Cancels any executing image operation for the receiver, if one exists.

- (void)cancelImageDownloadTask

Declared In

UIImageView+AFNetworking.h

UIRefreshControl(AFNetworking) Category Reference

UIRefreshControl(AFNetworking) Category Reference

Declared in UIRefreshControl+AFNetworking.h
UIRefreshControl+AFNetworking.m

Overview

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.

Refreshing for Session Tasks

– setRefreshingWithStateOfTask:

Binds the refreshing state to the state of the specified task.

- (void)setRefreshingWithStateOfTask:(NSURLSessionTask *)task

Parameters

task

The task. If nil, automatic updating from any previously specified operation will be disabled.

Declared In

UIRefreshControl+AFNetworking.h

CTLog Hierarchy
AFHTTPRequestQueryStringSerializationStyle Constants Reference

AFHTTPRequestQueryStringSerializationStyle Constants Reference

Declared in AFURLRequestSerialization.h

AFHTTPRequestQueryStringSerializationStyle

Definition

typedef NS_ENUM(NSUInteger, AFHTTPRequestQueryStringSerializationStyle ) {
   AFHTTPRequestQueryStringDefaultStyle = 0,
};

Constants

AFHTTPRequestQueryStringDefaultStyle

Declared In AFURLRequestSerialization.h.

Declared In

AFURLRequestSerialization.h