how to restart the UIView animation
I am new to the objective c coding in iPhone. i am using below code in separate function to start t开发者_JS百科he animation.
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:10.0];
object.transform = CGAffineTransformMakeRotation(1.57);
[UIView commitAnimations];
After this i am trying to restart the animation in one more separate function, before the time (10 sec that is mentioned in above).
So the thing is if i want to restart the animation in another function(but in the same .m file)once again at 5th sec. So please tell me how to solve this issue.
If you start a new animation while one is already in process for the same property/ies it should start animating to the new property values from whatever the current values are, using the new animation settings.
So when you say you want to reset the animation, do you mean you want it to go back to the start, or just do something different? If the former I believe you'll just need to set the property/ies (in this case your transform) back to its initial settings and start a new animation block.
精彩评论