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 ImageProcessors and storing the image to ImageCache of Kingfisher.

Public Properties

  • The file URL from which the image be loaded.

    Declaration

    Swift

    public let fileURL: URL

Initializers

  • 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 of fileURL is used.

Protocol Conforming