Kingfisher Documentation

Class Animated​Image​View.​Animator

public class Animator  

An animator which used to drive the data behind AnimatedImageView.

Member Of

AnimatedImageView

Represents a subclass of UIImageView for displaying animated image. Different from showing animated image in a normal UIImageView (which load all frames at one time), AnimatedImageView only tries to load several frames (defined by framePreloadCount) to reduce memory usage. It provides a tradeoff between memory usage and CPU time. If you have a memory issue when using a normal image view to load GIF data, you could give this class a try.

Properties

max​Frame​Count

public let maxFrameCount: Int

The maximum count of image frames that needs preload.

current​Frame​Image

public var currentFrameImage: UIImage?  

The image of the current frame.

current​Frame​Duration

public var currentFrameDuration: TimeInterval  

The duration of the current active frame duration.

current​Frame​Index

public internal(set) var currentFrameIndex = 0  

The index of the current animation frame.

is​Last​Frame

public var isLastFrame: Bool  

Whether the current frame is the last frame or not in the animation sequence.

Methods

frame(at:​)

public func frame(at index: Int) -> KFCrossPlatformImage?  

Gets the image frame of a given index.

Parameters

index Int

The index of desired image.

Returns

The decoded image at the frame. nil if the index is out of bound or the image is not yet loaded.

duration(at:​)

public func duration(at index: Int) -> TimeInterval