Gifu/Source/Classes/GIFImageView.swift

17 lines
635 B
Swift
Raw Normal View History

2018-02-17 15:14:53 +00:00
import UIKit
2016-10-01 11:41:22 +00:00
/// Example class that conforms to `GIFAnimatable`. Uses default values for the animator frame buffer count and resize behavior. You can either use it directly in your code or use it as a blueprint for your own subclass.
public class GIFImageView: UIImageView, GIFAnimatable {
/// A lazy animator.
public lazy var animator: Animator? = {
return Animator(withDelegate: self)
}()
/// Layer delegate method called periodically by the layer. **Should not** be called manually.
///
/// - parameter layer: The delegated layer.
override public func display(_ layer: CALayer) {
updateImageIfNeeded()
}
}