I am having 2 Buttons Start and Stop. If I click start button it starts it's rotation when i click stop button it stops at the exact position at the time of stop button is clicked.
again i click start button it starts it's rotation from the previous state.
How i Achieve this?
in Start i write this code
CABasicAnimation *rotation=[CABasicAnimationanimationWithKeyPath:@"transform.rotation"];
rotation.fromValue=[NSNumber numberWithFloat:0];
rotation.toValue=[NSNumber numberWithFloat:((360*M_PI)/180)];
rotation.duration=2;
rotation.repeatCounts=INFINITY;
[image.layer addAnimation:rotation forKey:@"Spin"];