ƒernando Valle
ƒernando Valle

Reputation: 3714

MKMapView detect when click in annotation balloon

There is any way to detect the click in the annotation balloon? I wanted that when user do click in a annotation, it will show some information and if the user want to see all the information he should do click again in the balloon (like Android). I have found how to implement

-(void)mapView:MKMapView*)mapView didSelectAnnotationView:MKAnnotationView *)view

but nothing about what I want to do, so is it possible?

Upvotes: 1

Views: 5703

Answers (1)

Craig
Craig

Reputation: 8304

If you set up your annotationView to contain an accessory button, which is pretty normal on iOS so users will feel comfortable, then this function will be called on your mapview's delegate when the user taps the accessory

- (void)mapView:(MKMapView *)map annotationView:(MKAnnotationView *)view calloutAccessoryControlTapped:(UIControl *)control;

From that you can determine which annotation was pressed and what to do about it

Upvotes: 4

Related Questions