AFImageDownloadPrioritization Constants Reference

AFImageDownloadPrioritization Constants Reference

Declared in AFImageDownloader.h

AFImageDownloadPrioritization

Definition

typedef NS_ENUM(NSInteger, AFImageDownloadPrioritization ) {
   AFImageDownloadPrioritizationFIFO,
   AFImageDownloadPrioritizationLIFO,
};

Constants

AFImageDownloadPrioritizationFIFO

Declared In AFImageDownloader.h.

AFImageDownloadPrioritizationLIFO

Declared In AFImageDownloader.h.

AFNetworkReachabilityStatus Constants Reference

AFNetworkReachabilityStatus Constants Reference

Declared in AFNetworkReachabilityManager.h

AFNetworkReachabilityStatus

Definition

typedef NS_ENUM(NSInteger, AFNetworkReachabilityStatus ) {
   AFNetworkReachabilityStatusUnknown = -1,
   AFNetworkReachabilityStatusNotReachable = 0,
   AFNetworkReachabilityStatusReachableViaWWAN = 1,
   AFNetworkReachabilityStatusReachableViaWiFi = 2,
};

Constants

AFNetworkReachabilityStatusUnknown

Declared In AFNetworkReachabilityManager.h.

AFNetworkReachabilityStatusNotReachable

Declared In AFNetworkReachabilityManager.h.

AFNetworkReachabilityStatusReachableViaWWAN

Declared In AFNetworkReachabilityManager.h.

AFNetworkReachabilityStatusReachableViaWiFi

Declared In AFNetworkReachabilityManager.h.

AFSSLPinningMode Constants Reference

AFSSLPinningMode Constants Reference

Declared in AFSecurityPolicy.h

AFSSLPinningMode

Definition

typedef NS_ENUM(NSUInteger, AFSSLPinningMode ) {
   AFSSLPinningModeNone,
   AFSSLPinningModePublicKey,
   AFSSLPinningModeCertificate,
};

Constants

AFSSLPinningModeNone

Declared In AFSecurityPolicy.h.

AFSSLPinningModePublicKey

Declared In AFSecurityPolicy.h.

AFSSLPinningModeCertificate

Declared In AFSecurityPolicy.h.

AFNetworkActivityManagerState Constants Reference

AFNetworkActivityManagerState Constants Reference

Declared in AFNetworkActivityIndicatorManager.m

AFNetworkActivityManagerState

Definition

typedef NS_ENUM(NSInteger, AFNetworkActivityManagerState ) {
   AFNetworkActivityManagerStateNotActive,
   AFNetworkActivityManagerStateDelayingStart,
   AFNetworkActivityManagerStateActive,
   AFNetworkActivityManagerStateDelayingEnd,
};

Constants

AFNetworkActivityManagerStateNotActive

Declared In AFNetworkActivityIndicatorManager.m.

AFNetworkActivityManagerStateDelayingStart

Declared In AFNetworkActivityIndicatorManager.m.

AFNetworkActivityManagerStateActive

Declared In AFNetworkActivityIndicatorManager.m.

AFNetworkActivityManagerStateDelayingEnd

Declared In AFNetworkActivityIndicatorManager.m.

CTLogType Constants Reference

CTLogType Constants Reference

Declared in CTLoggerDataDefines.h

CTLogType

Definition

typedef NS_ENUM(NSInteger, CTLogType ) {
   CTLogTypeBehavior = 0,
   CTLogTypeKeyBizTrace,
   CTLogTypeCrash,
   CTLogTypePage,
   CTLogTypePerformance,
};

Constants

CTLogTypeBehavior

Declared In CTLoggerDataDefines.h.

CTLogTypeKeyBizTrace

Declared In CTLoggerDataDefines.h.

CTLogTypeCrash

Declared In CTLoggerDataDefines.h.

CTLogTypePage

Declared In CTLoggerDataDefines.h.

CTLogTypePerformance

Declared In CTLoggerDataDefines.h.

AFImageCache Protocol Reference

AFImageCache Protocol Reference

Conforms to NSObject
Declared in AFAutoPurgingImageCache.h

Overview

The AFImageCache protocol defines a set of APIs for adding, removing and fetching images from a cache synchronously.

– addImage:withIdentifier: required method

Adds the image to the cache with the given identifier.

- (void)addImage:(UIImage *)image withIdentifier:(NSString *)identifier

Parameters

image

The image to cache.

identifier

The unique identifier for the image in the cache.

Declared In

AFAutoPurgingImageCache.h

– removeImageWithIdentifier: required method

Removes the image from the cache matching the given identifier.

- (BOOL)removeImageWithIdentifier:(NSString *)identifier

Parameters

identifier

The unique identifier for the image in the cache.

Return Value

A BOOL indicating whether or not the image was removed from the cache.

Declared In

AFAutoPurgingImageCache.h

– removeAllImages required method

Removes all images from the cache.

- (BOOL)removeAllImages

Return Value

A BOOL indicating whether or not all images were removed from the cache.

Declared In

AFAutoPurgingImageCache.h

– imageWithIdentifier: required method

Returns the image in the cache associated with the given identifier.

- (nullable UIImage *)imageWithIdentifier:(NSString *)identifier

Parameters

identifier

The unique identifier for the image in the cache.

Return Value

An image for the matching identifier, or nil.

Declared In

AFAutoPurgingImageCache.h

CTHttpNetWorkStatus Constants Reference

CTHttpNetWorkStatus Constants Reference

Declared in CTHttpManager.h

CTHttpNetWorkStatus

Definition

typedef NS_ENUM(NSInteger, CTHttpNetWorkStatus ) {
   CTHttpNetWorkStatusUnknown,
   CTHttpNetWorkStatusWifi,
   CTHttpNetWorkStatusNotReachable,
   CTHttpNetWorkStatusWWAN,
};

Constants

CTHttpNetWorkStatusUnknown

Declared In CTHttpManager.h.

CTHttpNetWorkStatusWifi

Declared In CTHttpManager.h.

CTHttpNetWorkStatusNotReachable

Declared In CTHttpManager.h.

CTHttpNetWorkStatusWWAN

Declared In CTHttpManager.h.

AFImageRequestCache Protocol Reference

AFImageRequestCache Protocol Reference

Conforms to AFImageCache
Declared in AFAutoPurgingImageCache.h

Overview

The ImageRequestCache protocol extends the ImageCache protocol by adding methods for adding, removing and fetching images from a cache given an NSURLRequest and additional identifier.

– addImage:forRequest:withAdditionalIdentifier: required method

Adds the image to the cache using an identifier created from the request and additional identifier.

- (void)addImage:(UIImage *)image forRequest:(NSURLRequest *)request withAdditionalIdentifier:(nullable NSString *)identifier

Parameters

image

The image to cache.

request

The unique URL request identifing the image asset.

identifier

The additional identifier to apply to the URL request to identify the image.

Declared In

AFAutoPurgingImageCache.h

– removeImageforRequest:withAdditionalIdentifier: required method

Removes the image from the cache using an identifier created from the request and additional identifier.

- (BOOL)removeImageforRequest:(NSURLRequest *)request withAdditionalIdentifier:(nullable NSString *)identifier

Parameters

request

The unique URL request identifing the image asset.

identifier

The additional identifier to apply to the URL request to identify the image.

Return Value

A BOOL indicating whether or not all images were removed from the cache.

Declared In

AFAutoPurgingImageCache.h

– imageforRequest:withAdditionalIdentifier: required method

Returns the image from the cache associated with an identifier created from the request and additional identifier.

- (nullable UIImage *)imageforRequest:(NSURLRequest *)request withAdditionalIdentifier:(nullable NSString *)identifier

Parameters

request

The unique URL request identifing the image asset.

identifier

The additional identifier to apply to the URL request to identify the image.

Return Value

An image for the matching request and identifier, or nil.

Declared In

AFAutoPurgingImageCache.h

KWInequalityType Constants Reference

KWInequalityType Constants Reference

Declared in KWInequalityMatcher.m

KWInequalityType

Definition

typedef NS_ENUM(NSUInteger, KWInequalityType ) {
   KWInequalityTypeLessThan,
   KWInequalityTypeLessThanOrEqualTo,
   KWInequalityTypeGreaterThan,
   KWInequalityTypeGreaterThanOrEqualTo,
};

Constants

KWInequalityTypeLessThan

Declared In KWInequalityMatcher.m.

KWInequalityTypeLessThanOrEqualTo

Declared In KWInequalityMatcher.m.

KWInequalityTypeGreaterThan

Declared In KWInequalityMatcher.m.

KWInequalityTypeGreaterThanOrEqualTo

Declared In KWInequalityMatcher.m.

AFMultipartFormData Protocol Reference

AFMultipartFormData Protocol Reference

Declared in AFURLRequestSerialization.h

Overview

The AFMultipartFormData protocol defines the methods supported by the parameter in the block argument of AFHTTPRequestSerializer -multipartFormRequestWithMethod:URLString:parameters:constructingBodyWithBlock:.

– appendPartWithFileURL:name:error: required method

Appends the HTTP header Content-Disposition: file; filename=#{generated filename}; name=#{name}" and Content-Type: #{generated mimeType}, followed by the encoded file data and the multipart form boundary.

- (BOOL)appendPartWithFileURL:(NSURL *)fileURL name:(NSString *)name error:(NSError *_Nullable __autoreleasing *)error

Parameters

fileURL

The URL corresponding to the file whose content will be appended to the form. This parameter must not be nil.

name

The name to be associated with the specified data. This parameter must not be nil.

error

If an error occurs, upon return contains an NSError object that describes the problem.

Return Value

YES if the file data was successfully appended, otherwise NO.

Discussion

The filename and MIME type for this data in the form will be automatically generated, using the last path component of the fileURL and system associated MIME type for the fileURL extension, respectively.

Declared In

AFURLRequestSerialization.h

– appendPartWithFileURL:name:fileName:mimeType:error: required method

Appends the HTTP header Content-Disposition: file; filename=#{filename}; name=#{name}" and Content-Type: #{mimeType}, followed by the encoded file data and the multipart form boundary.

- (BOOL)appendPartWithFileURL:(NSURL *)fileURL name:(NSString *)name fileName:(NSString *)fileName mimeType:(NSString *)mimeType error:(NSError *_Nullable __autoreleasing *)error

Parameters

fileURL

The URL corresponding to the file whose content will be appended to the form. This parameter must not be nil.

name

The name to be associated with the specified data. This parameter must not be nil.

fileName

The file name to be used in the Content-Disposition header. This parameter must not be nil.

mimeType

The declared MIME type of the file data. This parameter must not be nil.

error

If an error occurs, upon return contains an NSError object that describes the problem.

Return Value

YES if the file data was successfully appended otherwise NO.

Declared In

AFURLRequestSerialization.h

– appendPartWithInputStream:name:fileName:length:mimeType: required method

Appends the HTTP header Content-Disposition: file; filename=#{filename}; name=#{name}" and Content-Type: #{mimeType}, followed by the data from the input stream and the multipart form boundary.

- (void)appendPartWithInputStream:(nullable NSInputStream *)inputStream name:(NSString *)name fileName:(NSString *)fileName length:(int64_t)length mimeType:(NSString *)mimeType

Parameters

inputStream

The input stream to be appended to the form data

name

The name to be associated with the specified input stream. This parameter must not be nil.

fileName

The filename to be associated with the specified input stream. This parameter must not be nil.

length

The length of the specified input stream in bytes.

mimeType

The MIME type of the specified data. (For example, the MIME type for a JPEG image is image/jpeg.) For a list of valid MIME types, see http://www.iana.org/assignments/media-types/. This parameter must not be nil.

Declared In

AFURLRequestSerialization.h

– appendPartWithFileData:name:fileName:mimeType: required method

Appends the HTTP header Content-Disposition: file; filename=#{filename}; name=#{name}" and Content-Type: #{mimeType}, followed by the encoded file data and the multipart form boundary.

- (void)appendPartWithFileData:(NSData *)data name:(NSString *)name fileName:(NSString *)fileName mimeType:(NSString *)mimeType

Parameters

data

The data to be encoded and appended to the form data.

name

The name to be associated with the specified data. This parameter must not be nil.

fileName

The filename to be associated with the specified data. This parameter must not be nil.

mimeType

The MIME type of the specified data. (For example, the MIME type for a JPEG image is image/jpeg.) For a list of valid MIME types, see http://www.iana.org/assignments/media-types/. This parameter must not be nil.

Declared In

AFURLRequestSerialization.h

– appendPartWithFormData:name: required method

Appends the HTTP headers Content-Disposition: form-data; name=#{name}", followed by the encoded data and the multipart form boundary.

- (void)appendPartWithFormData:(NSData *)data name:(NSString *)name

Parameters

data

The data to be encoded and appended to the form data.

name

The name to be associated with the specified data. This parameter must not be nil.

Declared In

AFURLRequestSerialization.h

– appendPartWithHeaders:body: required method

Appends HTTP headers, followed by the encoded data and the multipart form boundary.

- (void)appendPartWithHeaders:(nullable NSDictionary<NSString*,NSString*> *)headers body:(NSData *)body

Parameters

headers

The HTTP headers to be appended to the form data.

body

The data to be encoded and appended to the form data. This parameter must not be nil.

Declared In

AFURLRequestSerialization.h

– throttleBandwidthWithPacketSize:delay: required method

Throttles request bandwidth by limiting the packet size and adding a delay for each chunk read from the upload stream.

- (void)throttleBandwidthWithPacketSize:(NSUInteger)numberOfBytes delay:(NSTimeInterval)delay

Parameters

numberOfBytes

Maximum packet size, in number of bytes. The default packet size for an input stream is 16kb.

delay

Duration of delay each time a packet is read. By default, no delay is set.

Discussion

When uploading over a 3G or EDGE connection, requests may fail with “request body stream exhausted”. Setting a maximum packet size and delay according to the recommended values (kAFUploadStream3GSuggestedPacketSize and kAFUploadStream3GSuggestedDelay) lowers the risk of the input stream exceeding its allocated bandwidth. Unfortunately, there is no definite way to distinguish between a 3G, EDGE, or LTE connection over NSURLConnection. As such, it is not recommended that you throttle bandwidth based solely on network reachability. Instead, you should consider checking for the “request body stream exhausted” in a failure block, and then retrying the request with throttled bandwidth.

Declared In

AFURLRequestSerialization.h