Created
May 13, 2013 11:15
-
-
Save arol/5567624 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 basic animation changing the transform.scale value | |
CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"transform.scale"]; | |
// Set the initial and the final values | |
[animation setFromValue:[NSNumber numberWithFloat:1.5f]]; | |
[animation setToValue:[NSNumber numberWithFloat:1.f]]; | |
// Set duration | |
[animation setDuration:0.5f]; | |
// Set animation to be consistent on completion | |
[animation setRemovedOnCompletion:NO]; | |
[animation setFillMode:kCAFillModeForwards]; | |
// Add animation to the view's layer | |
[[theView layer] addAnimation:animation forKey:@"scale"]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment