ImageCreatingOptions

public struct ImageCreatingOptions

Represents a set of image creating options used in Kingfisher.

  • The target scale of image needs to be created.

    Declaration

    Swift

    public let scale: CGFloat
  • The expected animation duration if an animated image being created.

    Declaration

    Swift

    public let duration: TimeInterval
  • For an animated image, whether or not all frames should be loaded before displaying.

    Declaration

    Swift

    public let preloadAll: Bool
  • For an animated image, whether or not only the first image should be loaded as a static image. It is useful for preview purpose of an animated image.

    Declaration

    Swift

    public let onlyFirstFrame: Bool
  • Creates an ImageCreatingOptions object.

    Declaration

    Swift

    public init(
        scale: CGFloat = 1.0,
        duration: TimeInterval = 0.0,
        preloadAll: Bool = false,
        onlyFirstFrame: Bool = false)

    Parameters

    scale

    The target scale of image needs to be created. Default is 1.0.

    duration

    The expected animation duration if an animated image being created. A value less or equal to 0.0 means the animated image duration will be determined by the frame data. Default is 0.0.

    preloadAll

    For an animated image, whether or not all frames should be loaded before displaying. Default is false.

    onlyFirstFrame

    For an animated image, whether or not only the first image should be loaded as a static image. It is useful for preview purpose of an animated image. Default is false.