Dynamically resize Annotation's callout

Hi,


I've got annotations on a MKMapView and I added a custom view inside the detailCalloutAccessoryView. This custom view performs a request and should present various amount of data depending on the request's reply. Basically, I can show 1 or 2 rows of data.

Sometimes, when I touch an annotation and the result is only one row, the callout is not resized. However, if I dimiss the annotation and select it once again, it is rendered correctly.


What is the "right" way to make it work? Using a intrinsicContentSize, or calling layoutIfNeeded (already tried, did not work)
Thanks for your help.

Replies

Hi!

Did you find a solution in the meantime?

The only way I could make it work was to do the following

annotationView.setSelected(false, animated: false)
annotationView.setSelected(true, animated: false)

but I'm not happy with this hack.