Gifu/Demo/demo/classes/ViewController.swift

21 lines
414 B
Swift
Raw Normal View History

2014-09-10 19:28:19 +00:00
import UIKit
2014-12-08 22:11:24 +00:00
import Gifu
2014-09-10 19:28:19 +00:00
class ViewController: UIViewController {
2015-01-22 10:54:27 +00:00
@IBOutlet weak var imageView: AnimatableImageView!
2014-09-10 19:28:19 +00:00
override func viewDidLoad() {
super.viewDidLoad()
imageView.animate(withGIFNamed: "mugen")
2014-09-10 19:28:19 +00:00
}
@IBAction func toggleAnimation(_ sender: AnyObject) {
if imageView.isAnimatingGIF {
imageView.stopAnimatingGIF()
2014-09-10 19:28:19 +00:00
} else {
imageView.startAnimatingGIF()
2015-06-05 15:14:52 +00:00
}
}
2014-09-10 19:28:19 +00:00
}