Skip to content

Instantly share code, notes, and snippets.

@kishorek
Forked from darkseed/gist:1144974
Created March 27, 2012 09:46
Show Gist options
  • Save kishorek/2214456 to your computer and use it in GitHub Desktop.
Save kishorek/2214456 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