Skip to content

Instantly share code, notes, and snippets.

@boherna
Last active June 17, 2018 13:07
Show Gist options
  • Save boherna/226a52bb539796da8302 to your computer and use it in GitHub Desktop.
Save boherna/226a52bb539796da8302 to your computer and use it in GitHub Desktop.
To animate (fade) text change in UILabel
CATransition *animation = [CATransition animation];
animation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
animation.type = kCATransitionFade;
animation.duration = 0.75;
[aLabel.layer addAnimation:animation forKey:@"kCATransitionFade"];
// The current text will fade to new text.
aLabel.text = @"new text";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment