I have a a menu that is a CALayer that will slide across the screen to a given point. I want the effect where the menu will go a little past the point, then a little before the point, and then land on the point. I can move the menu by applying a transform, but I was hoping to get this bouncing effect to work. I was looking into CAKeyframeAnimation, but I’m having trouble locating an example/tutorial. I’ve looked at the CA Programming Guide but haven’t really found anything. Any links or help would be great. Thanks.
Share
I released some code a while ago that does just what you’re looking for. Basically, you need to generate your own
CGPathRefcontaining all of the points you want the layer to hit, and use that path for thepathattribute of theCAKeyframeAnimation. The code will look something like this:The whole method is here.