Skip to content

Instantly share code, notes, and snippets.

@AhiyaHiya
Created August 22, 2017 15:04
Show Gist options
  • Select an option

  • Save AhiyaHiya/7c7d3c856a35ac539708a6fe87b31f7c to your computer and use it in GitHub Desktop.

Select an option

Save AhiyaHiya/7c7d3c856a35ac539708a6fe87b31f7c to your computer and use it in GitHub Desktop.
Animate UILabel... pretty simply said.
// https://stackoverflow.com/questions/3073520/animate-text-change-in-uilabel
//
- (void)animate:(UILabel*)label with:(NSString*)text
{
CATransition* animation = [CATransition animation];
animation.timingFunction =
[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
animation.type = kCATransitionFade;
animation.duration = 0.75;
[label.layer addAnimation:animation forKey:@"kCATransitionFade"];
label.text = text;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment