UIView.animate方法内执行CALayer动画
UIView.animate(withDuration: 10, delay: 0.0, options: .curveEaseOut, animations: {
self.layer.transform = CGAffineTransform(scaleX: 62.4, y: 62.4)
},completion: { finish in
UIView.animate(withDuration: 0.6, delay: 0.0, options: .curveEaseOut, animations: {
self.layer.transform = CGAffineTransform(scaleX: 50, y: 50)
})
})
需要注意: self.layer如果是CALayer类型, 那执行动画的时间并非由duration控制.
网友评论