/**
所谓关键帧动画,就是将Layer的属性作为KeyPath来注册,指定动画的起始帧和结束帧,然后自动计算和实现中间的过渡动画的一种动画方式。
*/
func startAnimation(){
println(__FUNCTION__)
// 设置动画
let anim = CABasicAnimation(keyPath: "transform.rotation")
//
anim.toValue = 2 * M_PI
anim.repeatCount = MAXFLOAT
anim.duration = 20.0
circleView.layer.addAnimation(anim, forKey: nil)
}
//停止动画
func stopAnimation(){
println(__FUNCTION__)
circleView.layer.removeAllAnimations()
}
转载于:https://my.oschina.net/u/150265/blog/422463