A single annotation callout should to be shown at any time, not working on iOS 12

Number:rdar://51063080 Date Originated:23/5/2019
Status:Duplicate of 43116193 Resolved:No
Product:iOS SDK MapKit Product Version:12.x
Classification:Bug Reproducible:Sometimes
The documentation for MapKit Annotation View callouts states that only one callout is visible at any given time. This doesn't seem to be the case on iOS 12, where it happens frequently (under the circumstances detailed below and illustrated in the sample code) that a previous callout stays visible, even though the code explicitly deselects all annotations.

Steps to Reproduce:

Our apps need to visually show several thousands (can get up to a million) items on the same map, so, in order not to overload the view and make it unusable, a preemptive filter is applied to limit the amount of pins shown to the area the user is looking at. When the user scrolls and zooms the map, the filter is re-applied and annotations are removed and added back according to the area. On iOS 11 and earlier, there's been no problem with this approach, but on iOS 12 we've started to notice that, when dragging/zooming the map with an open callout, sometimes it stays selected on a different annotation, and an additional callout is shown when tapped.
Explicitly deselecting annotations before rebuilding them seems to help, but doesn't fully solve the issue.

Expected Results:
When rebuilding the annotation list, callouts are cleared

Actual Results:
Sometimes a callout stays visible, and refers to a different annotation: a subsequent tap on a different annotation opens and additional callout.

iOS 12.x


All iOS devices


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!