public class Animator
An animator which used to drive the data behind
Represents a subclass of
UIImageViewfor displaying animated image. Different from showing animated image in a normal
UIImageView(which load all frames at one time),
AnimatedImageViewonly 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.
public let maxFrameCount: Int
The maximum count of image frames that needs preload.
public var currentFrameImage: UIImage?
The image of the current frame.
public var currentFrameDuration: TimeInterval
The duration of the current active frame duration.
public internal(set) var currentFrameIndex = 0
The index of the current animation frame.
public var isLastFrame: Bool
Whether the current frame is the last frame or not in the animation sequence.
public func frame(at index: Int) -> KFCrossPlatformImage?
Gets the image frame of a given index.
The index of desired image.
The decoded image at the frame.
nil if the index is out of bound or the image is not yet loaded.
public func duration(at index: Int) -> TimeInterval