Skip to content

Instantly share code, notes, and snippets.

@darkseed
Created August 14, 2011 15:21
Show Gist options
  • Save darkseed/1144974 to your computer and use it in GitHub Desktop.
Save darkseed/1144974 to your computer and use it in GitHub Desktop.
CABasicAnimation text animation
//Create a CABasicAnimation object. Must be added to the element after it is displayed
CATransition *animation = [CATransition animation];
animation.duration = 1.0;
animation.type = kCATransitionFade;
animation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
[myLabel.layer addAnimation:animation forKey:@"changeTextTransition"];
// Change the text and the animation will ocur
myLabel.text = @"Changed text";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment