Created
December 19, 2011 07:30
-
-
Save kyleturner/1495898 to your computer and use it in GitHub Desktop.
CALayer Animation Vertical Bounce
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
CABasicAnimation *bounceAnimation = [CABasicAnimation animationWithKeyPath:@"position.y"]; | |
bounceAnimation.duration = .75; | |
bounceAnimation.speed = 1.25; | |
bounceAnimation.fromValue = [NSNumber numberWithInt:0]; | |
bounceAnimation.toValue = [NSNumber numberWithInt:-15]; | |
bounceAnimation.repeatCount = INT_MAX; | |
bounceAnimation.autoreverses = YES; | |
bounceAnimation.fillMode = kCAFillModeForwards; | |
bounceAnimation.removedOnCompletion = NO; | |
bounceAnimation.additive = YES; | |
[annotationView.layer addAnimation:bounceAnimation | |
forKey:@"bounceAnimation |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment