IOS 更简洁的动画设置方式

func playAnimation()
{
UIView.animate(withDuration:5, delay:0, options:
[.curveEaseOut], animations:{
let view = self.view.viewWithTag(1)
view?.frame = CGRect(x:40, y:40, width:0,
height:0)
view?.backgroundColor = UIColor.blue
view?.alpha = 0
}, completion:{
(value:Bool) in
print(“Animaton stop.”)
self.view.viewWithTag(1)?.removeFromSuperview()
})
15 }

你可能感兴趣的:(IOS 更简洁的动画设置方式)