Kingfisher Documentation

Structure Local​File​Image​Data​Provider

public struct LocalFileImageDataProvider: ImageDataProvider  

Represents an image data provider for loading from a local file URL on disk. Uses this type for adding a disk image to Kingfisher. Compared to loading it directly, you can get benefit of using Kingfisher's extension methods, as well as applying ImageProcessors and storing the image to ImageCache of Kingfisher.

%169 LocalFileImageDataProvider LocalFileImageDataProvider ImageDataProvider ImageDataProvider LocalFileImageDataProvider->ImageDataProvider

Conforms To

ImageDataProvider

Represents a data provider to provide image data to Kingfisher when setting with Source.provider source. Compared to Source.network member, it gives a chance to load some image data in your own way, as long as you can provide the data representation for the image.

Initializers

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

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

Creates an image data provider by supplying the target local file URL.

Parameters

file​URL URL

The file URL from which the image be loaded.

cache​Key String?

The key is used for caching the image data. By default, the absoluteString of fileURL is used.

Properties

file​URL

public let fileURL: URL

The file URL from which the image be loaded.

cache​Key

public var cacheKey: String

The key used in cache.

content​URL

public var contentURL: URL?  

The URL of the local file on the disk.

Methods

data(handler:​)

public func data(handler: (Result<Data, Error>) -> Void)