Skip to content

Instantly share code, notes, and snippets.

@kyleturner
Created December 19, 2011 07:30
Show Gist options
  • Save kyleturner/1495898 to your computer and use it in GitHub Desktop.
Save kyleturner/1495898 to your computer and use it in GitHub Desktop.
CALayer Animation Vertical Bounce
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