Kingfisher Documentation

Protocol Resource

public protocol Resource  

Represents an image resource at a certain url and a given cache key. Kingfisher will use a Resource to download a resource from network and cache it with the cache key when using Source.network as its image setting source.

%33 Resource Resource ImageResource ImageResource ImageResource->Resource

Types Conforming to Resource

ImageResource

ImageResource is a simple combination of downloadURL and cacheKey. When passed to image view set methods, Kingfisher will try to download the target image from the downloadURL, and then store it with the cacheKey as the key in cache.

Default Implementations

convert​ToSource(override​Cache​Key:​)

public func convertToSource(overrideCacheKey: String? = nil) -> Source  

Converts self to a valid Source based on its downloadURL scheme. A .provider with LocalFileImageDataProvider associated will be returned if the URL points to a local file. Otherwise, .network is returned.

Requirements

cache​Key

var cacheKey: String  

The key used in cache.

download​URL

var downloadURL: URL  

The target image URL.