Created
January 27, 2012 22:27
-
-
Save samvermette/1691280 to your computer and use it in GitHub Desktop.
MapKit callout bubble pop animation
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
self.view.layer.anchorPoint = CGPointMake(0.50, 1.0); | |
CAKeyframeAnimation *bounceAnimation = [CAKeyframeAnimation animationWithKeyPath:@"transform.scale"]; | |
bounceAnimation.values = [NSArray arrayWithObjects: | |
[NSNumber numberWithFloat:0.05], | |
[NSNumber numberWithFloat:1.08], | |
[NSNumber numberWithFloat:0.92], | |
[NSNumber numberWithFloat:1.0], | |
nil]; | |
bounceAnimation.duration = 0.3; | |
[bounceAnimation setTimingFunctions:[NSArray arrayWithObjects: | |
[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut], | |
[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut], | |
[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut], | |
[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut], | |
nil]]; | |
bounceAnimation.removedOnCompletion = NO; | |
[self.view.layer addAnimation:bounceAnimation forKey:@"bounce"]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I analyzed UICalloutView "under a microscope" while it animated, inspecting its sequence of CABasicAnimations as it appeared, and I believe this is the exact sizing+timing sequence: