Last active
August 29, 2015 14:19
-
-
Save casspangell/185ce843496f72a71e3f to your computer and use it in GitHub Desktop.
Rotate UIView 360 Degrees
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
| - (void)animate { | |
| CABasicAnimation *rotate = [CABasicAnimation animationWithKeyPath:@"transform.rotation"]; | |
| rotate.byValue = @(M_PI*2); // Change to - angle for counter clockwise rotation | |
| rotate.duration = 5.0; | |
| rotate.repeatCount = HUGE_VALF; //rotates infinitely. Can be finite value. | |
| [self.view.layer addAnimation:rotate forKey:@"myRotationAnimation"]; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment