MapKit iOS 12 Beta: Changing Annotation Title

I have been trying to change the title of the annotation inside of the mapView didSelect function (

override public func mapView(_ mapView: MKMapView, didSelect view: MKAnnotationView)

), and this has been causing a lot of issues with callouts randomly appearing and not dismissing in the iOS 12 Beta. It works perfectly in previous iOS versions. Does anyone know what changed or what the issues may be?

Replies

Yes, same here.


In didSelect MapViewDelegate method, I attach a new view with detailCalloutAccessoryView (MKAnnotationView property).


Sometimes it's ok, sometimes the callout does not close itself on didDeselect and sometimes the callout stay opened and if I click the annotation again, I will have a very simple callout...


Very strange 🙂

I am experiencing the same issue. I attach a new view to detailCalloutAccessoryView. Sometimes closes, sometimes not. Sometimes default callout appears. This was working great until ios12, it is not new code.


Have you found any resolution to the problem?

For the callouts on my app, I create a UILabel for the accessory view and set the number of lines to 3. For iOS 11 this works great. For iOS 12, the first time the callout appears it only shows 1 line. The 2nd and succeeding times I tap it the number of lines is 3. Anyone else notice anything like this? Seems like a bug....

Hi

Since iOS12, detailCalloutAccessoryView appears with an animation.

For me when the map should scroll a little to show the bubble entirly, in example when your annotation is on the edge, a small empty bubble stay in background when you close the calloutview.

Do you have the same issue ?

Thank you

Hey there, did you find a solution to this problem meanwhile?


To me it seems like this only happens when I manipulate left/view/detailview of the callout (or add views etc) in the didSelect, but not when I do all of the setup in the `mapView(_:viewFor:)` method. I would prefer not doing this because loading all of the callouts before even showing them doesn't make much sense to me.


For now we'll just configure the view in `mapView(_:viewFor:) then.

Can you check iOS 12.1 ? it's seems working like in iOS 11 ...