I'm trying to update a custom annotation image dynamically but couldn't get it done. I have a custom annotation class that is of type MKPointAnnotation
which returns image name. Below is the code I have been working with...
class CustomAnnotation: MKPointAnnotation {
var imageName: String!
}
And based on the data I get from the server I'm changing the image name of the annotation:
self.annotation.imageName = "xyz.png";
I could see the updated image after I exit the view controller and reopening it again. Is there a way to update it dynamically without switching back and forth?