This is how MKMarkerAnnotationView annotations look in iOS 15 in my app.
The markers on the beach only consist of an image no bubble from the MKMarkerAnnotationView
With iOS 16 beta 3, many but not all images are hidden by the marker bubble; colors appear to be random.
MKMarkerAnnotationView is set like this:
self.glyphImage = myImage
self.glyphText = ""
self.glyphTintColor = UIColor.clear
self.markerTintColor = UIColor.clear
I checked in the debugger that this code is executed.
What is the cause and how can I prevent the bubbles from hiding the image?


The colors of the bubbles are colors that are used elsewhere in the app.
The following workaround fixes the problem:
in
public func mapView(_ mapView: MKMapView, viewFor annotation: MKAnnotation) -> MKAnnotationView? {...}replace
mapView.dequeueReusableAnnotationView(withIdentifier: identifier)and create a fresh instance ofMKMarkerAnnotationViewor your subclass ofMKMarkerAnnotationView.This is a bad workaround since
mapView.dequeueReusableAnnotationView(withIdentifier: identifier)is there for a reason, the workaround should have worse performance.The nature of the workaround suggests a bug in Apples implementation that the internal representation of the bubble is created only once or created only once if
UIColor.clearis used.Let's hope Apple fixes this until iOS 16 or someone comes up with a better answer.
App with workaround and iOS 16 beta 3:
Be aware that this workaround only helps in the case where the bubble always is invisible. It does not help in the case if you want the bubble sometimes visible and sometimes invisible vor the same annotation.