Created
July 1, 2013 15:05
-
-
Save scottsappen/5901644 to your computer and use it in GitHub Desktop.
iOS Label Animation (pre-IOS 6)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@property (weak, nonatomic) IBOutlet UILabel *LabelNotifications; | |
@synthesize LabelNotifications = _labelNotifications; | |
//viewDidLoad method | |
[_labelNotifications setAlpha:0.0]; | |
_labelNotifications.text = @"I am a label. I am going to fade in and out for the user!"; | |
[UIView animateWithDuration:2.0 | |
delay:0.0 | |
options:UIViewAnimationCurveEaseInOut | |
animations:^ { | |
_labelNotifications.alpha = 1.0; | |
NSLog(@"Animating notification label in"); | |
} | |
completion:^(BOOL finished) { | |
if(finished) | |
{ | |
[UIView animateWithDuration:3.0 | |
delay:2.0 | |
options:UIViewAnimationCurveEaseInOut | |
animations:^(void) | |
{ | |
_labelNotifications.alpha = 0.0; | |
NSLog(@"Animating notification label out"); | |
} | |
completion:^(BOOL finished) | |
{ | |
}]; | |
} | |
}]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment