Search code examples
iosswiftmkmapviewmkannotationview

MKMarkerAnnotationView title is not showing


Why MKMarkerAnnotationView title is getting disappearing. Some times title is appearing when we rotate map. How to make MKMarkerAnnotationView title should always visible.

enter image description here


Solution

  • MKMarkerAnnotationView has a property titleVisibility that can be set to one of the values

    .adaptive
    .hidden
    .visible
    

    .adaptive renders the title when there is space to do so, which is the default behaviour. If you want to see it always, set it to .visible.