废话少说,直接上代码:
var barsAnim = UIImageView(frame: self.view.frame);
barsAnim.animationImages = NSArray() as [AnyObject];
barsAnim.animationImages?.append(UIImage(named: "wave_000")!);
barsAnim.animationImages?.append(UIImage(named: "wave_001")!);
barsAnim.animationImages?.append(UIImage(named: "wave_002")!);
barsAnim.animationImages?.append(UIImage(named: "wave_003")!);
barsAnim.animationImages?.append(UIImage(named: "wave_004")!);
barsAnim.animationImages?.append(UIImage(named: "wave_005")!);
barsAnim.animationDuration = 2;
barsAnim.animationRepeatCount = 0;
barsAnim.startAnimating();
self.view.addSubview(barsAnim);
版权声明:本文为博主原创文章,未经博主允许不得转载。
原文地址:http://blog.csdn.net/wanglixin1999/article/details/47090027