Gifu/Demo/demo/classes/ViewController.swift

21 lines
414 B
Swift
Executable File

import UIKit
import Gifu
class ViewController: UIViewController {
@IBOutlet weak var imageView: AnimatableImageView!
override func viewDidLoad() {
super.viewDidLoad()
imageView.animate(withGIFNamed: "mugen")
}
@IBAction func toggleAnimation(_ sender: AnyObject) {
if imageView.isAnimatingGIF {
imageView.stopAnimatingGIF()
} else {
imageView.startAnimatingGIF()
}
}
}