a CAAnimation captures all the animation properties of the layer currently.
change the end properties by specifing values to the CAAnimation.
commit this CAAnimation.
the layer should be in the sublayers tree of CARootLayer
-
Frame.
-
opacity (alpha).
-
transform matrix.
CALayer* layer = ...;
CAAnimation* anime = NSObject::allocT2<CAAnimation>(layer, 2.f /**seconds*/);
anime->setFrame(endFrame);
anime->setAlpha(endAlpha);
anime->translate(endTranslateCTM);
anime->scale(endScaleCTM);
anime->rotate(endRotateCTM);
anime->commit();