作業-利用 UIImageView 實現多張圖片連續播放的動畫

放假啦 ))) 一起來擁抱陽光和沙灘吧
前腳踩的位置還真是到位啊,並不是刻意要站在那裡的,是(x: 90, y: 500)座標幫我決定的。
import UIKit
class ViewController: UIViewController {
@IBOutlet weak var imageView : UIImageView!
override func viewDidLoad() {
super.viewDidLoad()
let imageView = UIImageView(frame: CGRect(x: 90, y: 500, width: 221, height: 204))
let images = [UIImage(named: “dachshund0”)!,UIImage(named: “dachshund1”)!,UIImage(named: “dachshund2”)!,UIImage(named: “dachshund3”)!,UIImage(named: “dachshund4”)!,UIImage(named: “dachshund5”)!,UIImage(named: “dachshund6”)!,UIImage(named: “dachshund7”)!]
let animatedImage = UIImage.animatedImage(with: images, duration: 1)
imageView.image = animatedImage
view.addSubview(imageView)
}
}

--

--