In my application, I have the following line.
I have implemented a custom call bubble with a custom detailCalloutAccessoryView with two shortcuts inside.
I know how to change the color of detailCalloutAccessoryView with this line.
view.detailCalloutAccessoryView?.backgroundColor = UIColor.red
But I canβt understand how to change the background color of the main bubble (now it is transparent gray / white). With a line, view.detailCalloutAccessoryView?.backgroundColor = UIColor.redmy calloutbubble looks like this:

But I want my custom bubble to look like this:

Here is my view for the annotation method:
func mapView(_ mapView: MKMapView, viewFor annotation: MKAnnotation) -> MKAnnotationView? {
if annotation is MKUserLocation {
return nil
}
let identifier = "pin"
var view : MKAnnotationView
if let dequedView = mapView.dequeueReusableAnnotationView(withIdentifier: identifier) {
dequedView.annotation = annotation
view = dequedView
} else {
view = MKAnnotationView(annotation: annotation, reuseIdentifier: identifier)
view.canShowCallout = true
}
let pinImage = UIImage.init(named: "customPin")
DispatchQueue.main.async(execute: {
view.detailCalloutAccessoryView?.backgroundColor = UIColor.red
})
view.image = pinImage
configureDetailView(annotationView: view)
return view
}
I work in Xcode 8 w / Swift 3.
, .
xib , , .