What is the role of key path in Core Animation?

被刻印的时光 ゝ 提交于 2019-12-05 15:17:00
  • KeyPath says which animatable attribute is going to modified to create animation effect
  • You can use any of the animatable property as keypath
  • You can find them in the header file(say CALayer) on which you apply animation
 /* The position in the superlayer that the anchor point of the layer's
  bounds rect is aligned to. Defaults to the zero point. **Animatable**. */
   @property CGPoint position;
  • Not a constant String , it is attribute name

CABasicAnimation and CAKeyframeAnimation are inherited from CAPropertyAnimation. Both use its animationWithKeyPath: method.

KeyPath has to contain Animatable Properties. Find them here Link

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!