I am trying to use following code to perform few animations
-(void) performSlidingfromX:(int) xx fromY:(int) yy
{
UIImageView *Image= [self getImage];
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration: 1.0];
[UIView setAnimationBeginsFromCurrentState:true];
[UIView setAnimationCurve: UIViewAnimationCurveEaseOut];
[token setFrame:CGRectMake(xx, yy, 64, 64)];
[UIView commitAnimations];
}
and i am calling like it in for loop
for (i = 0; i < totMoves; i++) {
Moment *m = [moments objectAtIndex:i];
int xx= [m X];
int yy= [m Y];
[self performSlidingfromX:xx fromY:yy];
}
The problem that i am facing is that its animating to final position, for example , If i input the following moments for xx,yy
0,0
50,0
50,50
It moves the image from 0,0 to 50,50 diagonally, I want it to slide to horizantly first and then vertical.
Any Help?
Thanks