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


Represents a data provider to provide image data to Kingfisher when setting with Source.provider source. Compared to 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.



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

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


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.



public let fileURL: URL

The file URL from which the image be loaded.


public var cacheKey: String

The key used in cache.


public var contentURL: URL?  

The URL of the local file on the disk.



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