ImageCache

public protocol ImageCache

The ImageCache protocol defines a set of APIs for adding, removing and fetching images from a cache.

  • Adds the image to the cache with the given identifier.

    Declaration

    Swift

    func add(_ image: Image, withIdentifier identifier: String)
  • Removes the image from the cache matching the given identifier.

    Declaration

    Swift

    func removeImage(withIdentifier identifier: String) -> Bool
  • Removes all images stored in the cache.

    Declaration

    Swift

    @discardableResult
    func removeAllImages() -> Bool
  • Returns the image in the cache associated with the given identifier.

    Declaration

    Swift

    func image(withIdentifier identifier: String) -> Image?