2014-09-10 21:28:19 +02:00
|
|
|
import UIKit
|
2014-12-08 23:11:24 +01:00
|
|
|
import Gifu
|
2014-09-10 21:28:19 +02:00
|
|
|
|
|
|
|
class ViewController: UIViewController {
|
2015-01-22 11:54:27 +01:00
|
|
|
@IBOutlet weak var imageView: AnimatableImageView!
|
2015-06-09 14:28:11 -07:00
|
|
|
|
2014-09-10 21:28:19 +02:00
|
|
|
override func viewDidLoad() {
|
|
|
|
super.viewDidLoad()
|
2014-12-12 23:07:28 +01:00
|
|
|
|
2015-06-05 11:14:52 -04:00
|
|
|
imageView.animateWithImage(named: "mugen.gif")
|
2014-09-10 21:28:19 +02:00
|
|
|
}
|
|
|
|
|
2015-06-09 14:28:11 -07:00
|
|
|
@IBAction func toggleAnimation(sender: AnyObject) {
|
2014-11-10 22:57:37 +01:00
|
|
|
if imageView.isAnimatingGIF {
|
|
|
|
imageView.stopAnimatingGIF()
|
2014-09-10 21:28:19 +02:00
|
|
|
} else {
|
2014-11-10 22:57:37 +01:00
|
|
|
imageView.startAnimatingGIF()
|
2015-06-05 11:14:52 -04:00
|
|
|
}
|
|
|
|
}
|
2014-09-10 21:28:19 +02:00
|
|
|
}
|
|
|
|
|