Search code examples
swiftdictionaryviewmkmapview

How do I display all the title above a pin in map view?


I have completed a map view application in Swift which adds pin to the map view. How do I automatically display all the title above the pin without clicking them.


Solution

  • I don´t think it´s possible to show all the titles for your annotations at the same time. There is only support to show one title at a time.

    You can do that by adding this row:

    mapView.selectAnnotation(mapView.annotations[0], animated: true)
    

    Here I select the annotation with index 0.