I have this code, where successview start with alpha = 0.00
- (void) startAnimation{
//immediately
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:3];
[successView setAlpha:1.00];
[UIView commitAnimations];
//in three seconds
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:3];
[successView setAlpha:0.00];
[UIView commitAnimations];
}
in this way, in first animation (alpha 0.00 to 1.00), it don’t happen in 3 seconds but immediately, instead in the second animation (alpha 1.00 to alpha 0.00) it happens in 3 seconds
if I write only firts animation:
- (void) startAnimation{
//in three seconds
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:3];
[successView setAlpha:1.00];
[UIView commitAnimations];
}
it happens in 3 seconds, why in the forst example it don’t happen?
And add this animation delegate method: