I am using CAKeyFrameAnimation to do rotation of an arrow image.
Problem is that the imageview is returning back to the previos state after animation.
Code:
CAKeyframeAnimation *rotation = [CAKeyframeAnimation animation];
rotation.duration = 0.55;
rotation.cumulative = TRUE;
rotation.removedOnCompletion = NO;
if (isFlipRight) {
rotation.values = [NSArray arrayWithObjects:
[NSValue valueWithCATransform3D:CATransform3DMakeRotation(0.0, 0.0f, 1.0f, 0.0f)],
[NSValue valueWithCATransform3D:CATransform3DMakeRotation(M_PI, 0.0f, 1.0f, 0.0f)],nil];
} else { rotation.values = [NSArray arrayWithObjects: [NSValue valueWithCATransform3D:CATransform3DMakeRotation(M_PI, 0.0f, 1.0f, 0.0f)], [NSValue valueWithCATransform3D:CATransform3DMakeRotation(0.0, 0.0f, 1.0f, 0.0f)],nil];
}
[[arrowImageView layer] addAnimation:rotation forKey:@"transform"];