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