ImageRequestCache
public protocol ImageRequestCache : ImageCache
The ImageRequestCache
protocol extends the ImageCache
protocol by adding methods for adding, removing and
fetching images from a cache given an URLRequest
and additional identifier.
-
Adds the image to the cache using an identifier created from the request and identifier.
Declaration
Swift
func add(_ image: Image, for request: URLRequest, withIdentifier identifier: String?)
-
Removes the image from the cache using an identifier created from the request and identifier.
Declaration
Swift
func removeImage(for request: URLRequest, withIdentifier identifier: String?) -> Bool
-
Returns the image from the cache associated with an identifier created from the request and identifier.
Declaration
Swift
func image(for request: URLRequest, withIdentifier identifier: String?) -> Image?