Created
December 21, 2015 10:29
-
-
Save MaximAlien/f6abd0897a0af358f7f8 to your computer and use it in GitHub Desktop.
[iOS] Rotation animation using CABasicAnimation
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
CABasicAnimation *rotationAnimation = [CABasicAnimation animationWithKeyPath:@"transform.rotation.z"]; | |
rotationAnimation.duration = 2.0f; | |
rotationAnimation.removedOnCompletion = NO; | |
rotationAnimation.additive = YES; | |
rotationAnimation.fromValue = [NSNumber numberWithFloat:0]; | |
rotationAnimation.toValue = [NSNumber numberWithFloat:M_PI]; | |
rotationAnimation.fillMode = kCAFillModeForwards; | |
[self.customView.layer addAnimation:rotationAnimation forKey:@"rotationAnimation"]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment