GIFAnimatable

public protocol GIFAnimatable: class

The protocol that view classes need to conform to to enable animated GIF support.

  • Responsible for managing the animation frames.

    Declaration

    Swift

    var animator: Animator?
  • Used for displaying the animation frames.

    Declaration

    Swift

    var image: UIImage?
  • Notifies the instance that it needs display.

    Declaration

    Swift

    var layer: CALayer
  • View frame used for resizing the frames.

    Declaration

    Swift

    var frame: CGRect
  • Content mode used for resizing the frames.

    Declaration

    Swift

    var contentMode: UIViewContentMode
  • intrinsicContentSize Extension method

    Returns the intrinsic content size based on the size of the image.

    Declaration

    Swift

    public var intrinsicContentSize: CGSize
  • activeFrame Extension method

    Returns the active frame if available.

    Declaration

    Swift

    public var activeFrame: UIImage?
  • frameCount Extension method

    Total frame count of the GIF.

    Declaration

    Swift

    public var frameCount: Int
  • isAnimatingGIF Extension method

    Introspect whether the instance is animating.

    Declaration

    Swift

    public var isAnimatingGIF: Bool
  • animate(withGIFNamed:) Extension method

    Prepare for animation and start animating immediately.

    Declaration

    Swift

    public func animate(withGIFNamed imageName: String)

    Parameters

    imageName

    The file name of the GIF in the main bundle.

  • animate(withGIFData:) Extension method

    Prepare for animation and start animating immediately.

    Declaration

    Swift

    public func animate(withGIFData imageData: Data)

    Parameters

    imageData

    GIF image data.

  • Prepares the animator instance for animation.

    Declaration

    Swift

    public func prepareForAnimation(withGIFNamed imageName: String)

    Parameters

    imageName

    The file name of the GIF in the main bundle.

  • Prepare for animation and start animating immediately.

    Declaration

    Swift

    public func prepareForAnimation(withGIFData imageData: Data)

    Parameters

    imageData

    GIF image data.

  • prepareForReuse() Extension method

    Stop animating and free up GIF data from memory.

    Declaration

    Swift

    public func prepareForReuse()
  • startAnimatingGIF() Extension method

    Start animating GIF.

    Declaration

    Swift

    public func startAnimatingGIF()
  • stopAnimatingGIF() Extension method

    Stop animating GIF.

    Declaration

    Swift

    public func stopAnimatingGIF()
  • updateImageIfNeeded() Extension method

    Updates the image with a new frame if necessary.

    Declaration

    Swift

    public func updateImageIfNeeded()