Swift CABasicAnimation に指定可能なkeypath 一覧
2 min readNov 7, 2017
CoreGraphics+CoreAnimationではCALayerにAnimationを追加するとアニメーションすることができる。
回転の例(上の回転の部分のみ)
let rotateAnim = CABasicAnimation(keyPath: "transform.rotation")
rotateAnim.fromValue = 0
rotateAnim.toValue = CGFloat.pi * 2.0rotateAnim.duration = 5.0
rotateAnim.repeatDuration = CFTimeInterval.infinity
shapeLayer.add(rotateAnim, forKey: "rotateAnim")
CABasicAnimationのkeyPathに指定可能な値は以下に記載されている。
Animatable Properties Core Animation Programming Guide
transform.rotaion
のようなさらに深い部分はこちらを参照すると良い。
Core Animation Programming Guide Key-Value Coding Extensions