import UIKit
17
18 class ViewController:UIViewController {
19
20 override func viewDidLoad() {
21 super.viewDidLoad()
22 // Do any additional setup after loading the view,
typically from a nib.
23
24 var images = UIImage
25 for i in 1 …… 19{
26 images.append(UIImage(named:“animation(i)”)!)
27 }
28
29 let imageView = UIImageView(frame:CGRect(x:0,
y:60, width:335, height:253))
30 imageView.animationImages = images
31 imageView.animationDuration = 5
32 imageView.animationRepeatCount = 0
33 imageView.startAnimating()
34
35 self.view.addSubview(imageView)
36 }
37 }