CALayer动画需要注意的事项

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控制.

你可能感兴趣的:(CALayer动画需要注意的事项)