imzyf / ios-swift-learning-notes

📝 iOS Swift Learning Notes - see Issues
MIT License
0 stars 0 forks source link

动画结束回调以及动画不还原的方法 #32

Open imzyf opened 6 years ago

imzyf commented 6 years ago

http://www.jianshu.com/p/a8c9671adb28

回调

animationGroup.delegate = self

func animationDidStop(_ anim: CAAnimation, finished flag: Bool) {
  // ...
}

不还原

// 动画结束后不删除动画,否则在回调中无法得到动画
anim.fillMode = kCAFillModeForwards
// 设置动画不还原
anim.isRemovedOnCompletion = false