5

This seems like a really basic question that has been surprisingly hard to find an answer to.

CABasicAnimations set up with "affineTransform" as the keypath haven't worked for me, and in a bunch of places I've seen people eventually resorting to use CATransform3D instead with the "transform" keypath. Sure that's a hint, but it would be good to have confirmation if "affineTransform" is meant to work or not?

Dev Kanchen
  • 2,332
  • 3
  • 28
  • 40

1 Answers1

10

Technically, affineTransform is not a property of CALayer, and is documented as a "convenience method" wrapper around the transform property, which is documented as animatable.

It's only really by objective-c's implicit conversion of keypaths to selectors that it appears affineTransform behaves like a property when use (under most circumstances) in a keypath. However, the CA libraries are setup to observe only certain keypaths, and that's not one of them :-)

Chris Trahey
  • 18,202
  • 1
  • 42
  • 55