Created
December 14, 2011 02:24
-
-
Save amro/1474947 to your computer and use it in GitHub Desktop.
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
//Start at negative kWiggleAnimationAngle so we animate to positive kWiggleAnimationAngle | |
view.layer.transform = CATransform3DMakeRotation(-kWiggleAnimationAngle, 0, 0, 1.0); | |
//Setup a transform that will rotate our view to positive kWiggleAnimationAngle | |
CATransform3D transform = CATransform3DMakeRotation(kWiggleAnimationAngle, 0, 0, 1.0); | |
//Setup our animation with the transform | |
CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"transform"]; | |
animation.toValue = [NSValue valueWithCATransform3D:transform]; | |
animation.repeatCount = HUGE_VALF; | |
animation.duration = 0.1; | |
animation.autoreverses = YES; | |
[view.layer addAnimation:animation forKey:@"wiggle"]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment