MKPointAnnotation title problem

Hi,

On one of my apps, I have been adding some MKPointAnnotations to a map and showing a pin and showing some text as a title above the pin,


Fairly basic code as per below.

(Not full code of course, just to give an idea.)



func addMarkerToMap() {

let annotation = MKPointAnnotation()

annotation.title = "My Title"

annotation.coordinate = CLLocationCoordinate2D(latitude: sLatitude!, longitude: sLongitude!)

myMap.addAnnotation(annotation)

}



func mapView(_ mapView: MKMapView, viewFor annotation: MKAnnotation) -> MKAnnotationView? {

if annotation is MKPointAnnotation {

let pinAnnotationView = MKPinAnnotationView(annotation: annotation, reuseIdentifier: "myPin")

pinAnnotationView.pinTintColor = .blue

pinAnnotationView.isDraggable = false

pinAnnotationView.canShowCallout = true

pinAnnotationView.animatesDrop = true

pinAnnotationView.isSelected = true

return pinAnnotationView

}

return nil

}

}



This has been working fine until IOS was updated to IOS 13.4.

Now it will only ever show a title if it only contains 1 character.

Any more than 1 character and all the pin title shows is 3 dots.


Does anyone know if this is a IOS bug, or is there a way I can set the frame size of the MKPointannotation so that I can once again fit the full title in?


Thanks for any advice.

Replies

have you found solutions to this problem? is it a bug or is it possible to set the length? I saw that either image or title max one character is displayed ... thanks

I am facing the exact same problem. One of my app is using MKAnnotationView and whenever I set title of more than one character, it shows me "..." and nothing else. What I think is it is a some sort of bug on MKAnnotationView Library that is not letting caller to set a title or subtitle more than 1 character. It is quite frustrating.


If anyone finds a solution. Please post here.


Regards.