Created
June 21, 2012 22:31
-
-
Save mlaster/2969010 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
- (CAAnimation *)rotationAnimation { | |
CABasicAnimation *rotation = [CABasicAnimation animationWithKeyPath:@"transform"]; | |
rotation.valueFunction = [CAValueFunction functionWithName:kCAValueFunctionRotateZ]; | |
rotation.fromValue = [NSNumber numberWithFloat:0.0]; | |
rotation.toValue = [NSNumber numberWithFloat:M_PI * 2]; | |
rotation.duration = 2.0f; | |
rotation.repeatCount = INFINITY; | |
rotation.removedOnCompletion = NO; | |
return rotation; | |
} | |
... | |
[layer addAnimation:[self rotationAnimation] forKey:@"animation"]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment