Search code examples
iphonecore-animationmkmapview

Animating custom callout for MKAnnotationView in MKMapView with "pop in" effect


I finally managed to put together a custom callout UIView that gets shown when a MKAnnotationView is tapped. I did this by overriding

- (void)setSelected:(BOOL)selected animated:(BOOL)animated;

in my custom MKAnnotationView subclass. Note: I prevented the main callout from showing by setting the canShowCallout property to NO.

I'd like to try and replicate the animation that the standard callout uses... It seems to bubble up -- going a little bigger than intended, and then back to it's normal size. So far, I seem to be at a loss trying to figure out how to produce a similar animation with core animation. Anyone have any suggestions or pointers?

Thanks in advance!


Solution

  • I found a decent solution for this one. The ftutils library provides a pop in animation. It's really easy to call too:

    #import "FTAnimation.h"
    
    [self.viewToAnimate popIn:.4 delegate:nil];