Kingfisher Documentation

Structure Image​Resource

public struct ImageResource: Resource  

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.

%11 ImageResource ImageResource Resource Resource ImageResource->Resource

Conforms To

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.

Initializers

init(download​URL:​cache​Key:​)

public init(downloadURL: URL, cacheKey: String? = nil)  

Creates an image resource.

Parameters

download​URL URL

The target image URL from where the image can be downloaded.

cache​Key String?

The cache key. If nil, Kingfisher will use the absoluteString of downloadURL as the key. Default is nil.

Properties

cache​Key

public let cacheKey: String

The key used in cache.

download​URL

public let downloadURL: URL

The target image URL.