tags:

views:

166

answers:

1

Hi,

I am new to the objective c coding in iPhone. i am using below code in separate function to start the 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.

A: 

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.

Phil Nash
in above code the animation will take 10 seconds. After just completing 5 seconds i need to increase the speed of animation. This is my concern.
That should be straightforward then. Start a new animation with the same transform, but a shorter duration. E.g. after 5 seconds start the new animation to work over 2 seconds instead.
Phil Nash