Kingfisher Documentation

Protocol Image​Modifier

public protocol ImageModifier  

An ImageModifier can be used to change properties on an image between cache serialization and the actual use of the image. The modify(_:) method will be called after the image retrieved from its source and before it returned to the caller. This modified image is expected to be only used for rendering purpose, any changes applied by the ImageModifier will not be serialized or cached.

%109 ImageModifier ImageModifier FlipsForRightToLeftLayoutDirectionImageModifier FlipsForRightToLeftLayoutDirectionImageModifier FlipsForRightToLeftLayoutDirectionImageModifier->ImageModifier AnyImageModifier AnyImageModifier AnyImageModifier->ImageModifier AlignmentRectInsetsImageModifier AlignmentRectInsetsImageModifier AlignmentRectInsetsImageModifier->ImageModifier RenderingModeImageModifier RenderingModeImageModifier RenderingModeImageModifier->ImageModifier

Types Conforming to Image​Modifier


A wrapper for creating an ImageModifier easier. This type conforms to ImageModifier and wraps an image modify block. If the block throws an error, the original image will be used.


Modifier for setting the rendering mode of images.


Modifier for setting the flipsForRightToLeftLayoutDirection property of images.


Modifier for setting the alignmentRectInsets property of images.



func modify(_ image: KFCrossPlatformImage) -> KFCrossPlatformImage

Modify an input Image.


image KFCross​Platform​Image

Image which will be modified by self


The modified image.