Hi !
I'm trying to change the text of an UILabel with a little transition (fade out, change text, fade in) but I'm facing some problems. Here is my code:
- (void) setTextWithFade:(NSString *)text {
[self setAlpha:1];
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:.25];
[UIView setAnimationDelegate:self];
[UIView setAnimationDidStopSelector:@selector(fadeDidStop:finished:context:)];
[self setAlpha:0];
[UIView commitAnimations];
}
- (void)fadeDidStop:(NSString *)animationID finished:(NSNumber *)finished context:(void *)context {
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:.25];
[self setAlpha:1];
[UIView commitAnimations];
}
This code "works" (the effect is working well), but what I can't figure out is how to change the label text in the "fadeDidStop" function... How can I "pass" the text variable from my first function to the second?
Thanks in advance