I have a shortcut that I want to fade out and then fade. here is my code:
-(void) fadein { scoreLabel.alpha = 0; [UIView beginAnimations:nil context:nil]; [UIView setAnimationCurve:UIViewAnimationCurveEaseIn]; [UIView setAnimationDuration:2]; scoreLabel.alpha = 1; [UIView commitAnimations]; [UIView setAnimationDidStopSelector:@selector(animationDidStop:finished:context:)]; } -(void)animationDidStop:(NSString *)animationID finished:(NSNumber *)finished context:(void *)context { [UIView beginAnimations:nil context:nil]; [UIView setAnimationDuration:2]; scoreLabel.alpha = 0; [UIView commitAnimations]; }
from this code i get this situation: my label disappears and then i don't see the fadeout animation. how can i fix this?
source share