Structures

The following structures are available globally.

  • Represents a basic and default CacheSerializer used in Kingfisher disk cache system. It could serialize and deserialize images in PNG, JPEG and GIF format. For image other than these formats, a normalized pngRepresentation will be used.

    See more

    Declaration

    Swift

    public struct DefaultCacheSerializer : CacheSerializer
  • FormatIndicatedCacheSerializer lets you indicate an image format for serialized caches.

    It could serialize and deserialize PNG, JPEG and GIF images. For image other than these formats, a normalized pngRepresentation will be used.

    Example:

    let profileImageSize = CGSize(width: 44, height: 44)
    
    // A round corner image.
    let imageProcessor = RoundCornerImageProcessor(
        cornerRadius: profileImageSize.width / 2, targetSize: profileImageSize)
    
    let optionsInfo: KingfisherOptionsInfo = [
        .cacheSerializer(FormatIndicatedCacheSerializer.png), 
        .processor(imageProcessor)]
    
    A URL pointing to a JPEG image.
    let url = URL(string: "https://example.com/image.jpg")!
    
    // Image will be always cached as PNG format to preserve alpha channel for round rectangle.
    // So when you load it from cache again later, it will be still round cornered.
    // Otherwise, the corner part would be filled by white color (since JPEG does not contain an alpha channel).
    imageView.kf.setImage(with: url, options: optionsInfo)
    
    See more

    Declaration

    Swift

    public struct FormatIndicatedCacheSerializer : CacheSerializer
  • Represents the caching operation result.

    See more

    Declaration

    Swift

    public struct CacheStoreResult
  • Wrapper for Kingfisher compatible types. This type provides an extension point for connivence methods in Kingfisher.

    See more

    Declaration

    Swift

    public struct KingfisherWrapper<Base>

Deprecated