Search code examples
iosmkannotationmkannotationviewmapkit

Add a button to MapKit callout at bottom center (not accessory)


I have an interesting challenge. I need to create a callout for an MKAnnotation that has a slightly custom look on my map. It has a right accessory view, but it also requires a button in the bottom center of the callout.

Is there a way to create a button and place it on the callout or is it possible to move the location of the left accessory so that it is in bottom center?


Solution

  • Use MKAnnotationView, as you've tagged in your question. Loads of resources and info if you search - this post seems like a good start to making a custom callout. You'll be able to add the changes to the look as you outline in your question.

    If you want to change any aspect of the look and behaviour of the map callout you will need to provide a custom implementation.