Here is a great link with some examples of how to use it:
(After some searching, I found this: http://www.cocoanetics.com/2012/06/lets-bounce/ , which, in my opinion, bounces much better, but is more advanced. The code is here)
http://www.touchwonders.com/some-techniques-for-bouncing-animations-in-ios/
An example with CAKeyframeAnimation would be: (taken from link)
-(void)animateGreenBall { NSValue * from = [NSNumber numberWithFloat:greenBall.layer.position.y]; CGFloat bounceDistance = 20.0; CGFloat direction = (greenUp? 1 : -1); NSValue * via = [NSNumber numberWithFloat:(greenUp ? HEIGHT_DOWN : HEIGHT_UP) + direction*bounceDistance]; NSValue * to = greenUp ? [NSNumber numberWithFloat:HEIGHT_DOWN] : [NSNumber numberWithFloat:HEIGHT_UP]; NSString * keypath = @"position.y"; [greenBall.layer addAnimation:[self keyframeBounceAnimationFrom:from via:via to:to forKeypath:keypath withDuration:.6] forKey:@"bounce"]; [greenBall.layer setValue:to forKeyPath:keypath]; greenUp = !greenUp; } -(CAKeyframeAnimation *)keyframeBounceAnimationFrom:(NSValue *)from via:(NSValue *)via to:(NSValue *)to forKeypath:(NSString *)keyPath withDuration:(CFTimeInterval)duration { CAKeyframeAnimation * animation = [CAKeyframeAnimation animationWithKeyPath:keyPath]; [animation setValues:[NSArray arrayWithObjects:from, via, to, nil]]; [animation setKeyTimes:[NSArray arrayWithObjects:[NSNumber numberWithFloat:0.0], [NSNumber numberWithFloat:.7], [NSNumber numberWithFloat:1.0], nil]]; animation.duration = duration; return animation; }
source share