LocalFileImageDataProvider
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 ImageProcessor
s and storing the image to ImageCache
of Kingfisher.
-
The file URL from which the image be loaded.
Declaration
Swift
public let fileURL: URL
-
Creates an image data provider by supplying the target local file URL.
Declaration
Swift
public init(fileURL: URL, cacheKey: String? = nil)
Parameters
fileURL
The file URL from which the image be loaded.
cacheKey
The key is used for caching the image data. By default, the
absoluteString
offileURL
is used.
-
The key used in cache.
Declaration
Swift
public var cacheKey: String
-
Declaration
Swift
public func data(handler: (Result<Data, Error>) -> Void)