When I write my animation code within beginAnimation-commitAnimatin blocks I get a bouncing effect, however I don’t get the same effect when I do the same animation with the method written in the subject. Here are two ways to do what I want:
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDelay:0.5];
[UIView setAnimationDuration:1];
[UIView setAnimationCurve:UIViewAnimationCurveEaseIn];
[UIView setAnimationRepeatAutoreverses:YES];
[UIView setAnimationRepeatCount:2];
[UIView setAnimationDelegate:self];
[UIView setAnimationDidStopSelector:
@selector(resetTheChickenProperties)];
theChicken.frame = CGRectMake(15, 330, 62, 90);
[UIView commitAnimations];
the way shown above the image (it’s an egg) goes down in the y direction until it hits the ground and bounces back. Bouncing effect is clearly observed. But if I do the same thing with the help of the animateWithDuration:delay:options:animations:compeletion method the egg does not bounce. It rather seems like hung on a spring.
OK, I’ve found the subtle detail everyone needs to take note of in order to get the animation and transitions work with the method available in iOS 4 and later.When specifying the animation/transition options for the method we must use the constants with the word “Option” in it. So instead of writing
we should write
after fixing that the animation worked just fine. I was able to get the real bouncing effect