Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is "affineTransform" a valid CALayer keypath for setting up CABasicAnimation

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?

like image 576
Dev Kanchen Avatar asked Aug 31 '12 06:08

Dev Kanchen


1 Answers

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 :-)

like image 154
Chris Trahey Avatar answered Nov 12 '22 21:11

Chris Trahey