View Full Version : How can you change value of animation while it's animating?

Dec 18, 2008, 02:21 PM
I'm animating a UIView to a new Y location by changing the frame like this:

[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:duration];
[UIView setAnimationDelegate:self];
mview.frame = newFrame;
[UIView commitAnimations];

Let's say newFrame currently has origin.y = 100. Now, while it's animating I need to change that to 200. Is there anyway to update the current animation or do I have to cancel the first one and start a new animation? I did try that, but there's a noticeable pause where the first animation stop and the new one starts.