5

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"];
Toseef Khilji
  • 17,192
  • 12
  • 80
  • 121
Suresh Peddisetti
  • 3,782
  • 3
  • 23
  • 26
  • 3
    Check this post http://stackoverflow.com/questions/9844925/uiview-infinite-360-degree-rotation-animation – DogCoffee Oct 05 '13 at 05:28

0 Answers0