Skip to content

Instantly share code, notes, and snippets.

@scottsappen
Created July 1, 2013 15:05
Show Gist options
  • Save scottsappen/5901644 to your computer and use it in GitHub Desktop.
Save scottsappen/5901644 to your computer and use it in GitHub Desktop.
iOS Label Animation (pre-IOS 6)
@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