8

Is it possible to use CAKeyframeAnimation to move something along a path and at the same time use some sort of easing so there is acceleration or deceleration? I know there is timingFunctions and keyTimes, but I don't see how they would work if you are simply moving along a path.

Brian
  • 3,571
  • 7
  • 44
  • 70

1 Answers1

23

Something like

anim.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseOut]

?

Or swift 5:

anim.timingFunction = CAMediaTimingFunction(name: CAMediaTimingFunctionName.easeInEaseOut)
Guntis Treulands
  • 4,764
  • 2
  • 50
  • 72
adam
  • 22,404
  • 20
  • 87
  • 119
  • I should have looked. Only saw timingFunctions as a property on CAKeyframeAnimation. Didn't think to look if there was a single property on CABAsicAnimation. Thanks. – Brian May 03 '11 at 12:20
  • I looked and some of the docs explicitly say this value is ignored for keyframe animations. Those docs are wrong; this works. – buildsucceeded Oct 06 '16 at 13:57