-
-
Save kishorek/2214453 to your computer and use it in GitHub Desktop.
CABasicAnimation movement
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Create a CABasicAnimation object | |
CABasicAnimation *move = [CABasicAnimation animationWithKeyPath:@"transform.translation.y" ]; | |
[move setFromValue:[NSNumber numberWithFloat:0.0f]]; | |
[move setToValue:[NSNumber numberWithFloat:100.0f]]; | |
[move setDuration:0.3f]; | |
//Add animation to a specific element's layer. Must be called after the element is displayed. | |
[[element layer] addAnimation:move forKey:@"transform.translation.y"]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment