how to change image of rightCalloutAccessoryView's button of annotation view in Map view? I have used following method to set button in annotation view.
annotationView!.rightCalloutAccessoryView = UIButton(type: .detailDisclosure)
(annotationView?.rightCalloutAccessoryView as! UIButton).setImage(UIImage(named: "abc"), for: .normal)
I have also tried with custom button, it won't change
Swift 4
Create your button, set the image and assign in rightCalloutView.
let annotationView = MKMarkerAnnotationView(annotation: annotation, reuseIdentifier: identifier)
let rightButton = UIButton(type: .detailDisclosure)
rightButton.setImage( UIImage(named: "map1"), for: .normal)
annotationView.rightCalloutAccessoryView = rightButton
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With