How to permanently leave a CALayer rotated at its final location?
- by David
Hello,
I am trying to rotate a CALayer to a specific angle however, once the animation is done, the layer jumps back to its original position. How would I rotate the layer properly so that it stays at its final destination?
Here is the code that I am using
CABasicAnimation *rotationAnimation =[CABasicAnimation animationWithKeyPath:@"transform.rotation.z"]; //Rotate about z-axis
[rotationAnimation setFromValue:[NSNumber numberWithFloat:fromDegree]];
[rotationAnimation setToValue:[NSNumber numberWithFloat:toDegree]];
[rotationAnimation setDuration:0.2];
[rotationAnimation setRemovedOnCompletion:YES];
[rotationAnimation setFillMode:kCAFillModeForwards];
Any suggestions? Thank you.