I have some code which works nicely and acts like a menu appearing when you click a button. I just want to animate slightly. So when it appears, it appears to bounce in. Here's the code which shows it
[UIView beginAnimations:@"theAnimation" context:NULL];
[UIView setAnimationDelegate:self];
[UIView setAnimationDidStopSelector:@selector(yourAnimationHasFinished:finished:context:)];
[UIView setAnimationDuration: 0.3];
CGAffineTransform moveUp = CGAffineTransformMakeTranslation(0, -20);
scrollChangeClothing.transform = moveUp;
imgClothesMenuBg.transform = moveUp;
[UIView commitAnimations];
[UIView beginAnimations:@"theAnimation" context:NULL];
[UIView setAnimationDelegate:self];
[UIView setAnimationDidStopSelector:@selector(yourAnimationHasFinished:finished:context:)];
[UIView setAnimationDuration: 0.1];
CGAffineTransform moveUp = CGAffineTransformMakeTranslation(0, 0);
scrollChangeClothing.transform = moveUp;
imgClothesMenuBg.transform = moveUp;
[UIView commitAnimations];
the code above (I thought) should first show the image at -20 pixels start point, then settle back to it's original point.
I tried combining the transform commands but that didnt work either. Do I need to put the second animation in the setAnimationDidStopSelector?? So once it's finished, it will then bounce?