Colby Swandale
Colby Swandale

Reputation: 39

Display Apple's call out bubble on custom MKAnnotation

I have a custom MKAnnotation and all the annotations are all in the right place and have followed the MKAnnotation's Protocol but i want to display the standard call out bubble when the user taps on the annotation, can I do this or do I have the implement a custom call out bubble?

Upvotes: 1

Views: 782

Answers (1)

PeyloW
PeyloW

Reputation: 36752

You need to set the canShowCallout property to YES for the MKAnnotationView you create to represent your particular MKAnnotation.

The call out will use the title property from your MKAnnotation as it's title, and also the subtitle property if it is not nil.

You can set the leftCalloutAccessoryView and rightCalloutAccessoryView properties on the MKAnnotationView if you want or need to. The left view is usually a UIImageView with an icon, and the right view is usually a UIButton that acts as a detail disclosure button.

Upvotes: 2

Related Questions