I am developing an app in which i am rotating a view by 360 degree but i am not able to rotate it 360 degree. It is getting rotated by 180 degree and after getting rotated it is coming back to it's original position..
animation = [CABasicAnimation animationWithKeyPath:@"transform"];
transform = CATransform3DMakeRotation(3.14f, 1.0f, 1.0f, 1.0f);
value = [NSValue valueWithCATransform3D:transform];
[animation setToValue:value];
[animation setAutoreverses:YES];
[animation setDuration:0.9];
[[rotatBall layer] addAnimation:animation forKey:@"180"]; //rotatBall is a view
In other words,it is making back and forth rotation. How to rotate it continuously.... Kindly help...
That's a little bit tricky but you can find it in the docs.
To rotate it continuously you first need to set the
toValue
then set the animation repeat count toHUGH_VALF
(defined in math.h).