Swift MapKit:使用 addAnnotations() 后需要移动地图以显示注释

Swift MapKit : need to move map to show annotations after using addAnnotations()

使用 addAnnotations() 添加注释数组后,我需要移动地图(使用鼠标)才能显示注释!这很烦人。哈哈

有人知道如何解决这个问题吗?

建议在主线程做UI修改,是否在主线程添加注解?

添加注释时,试试这个:

DispatchQueue.main.async {  

     yourMapView.addAnnotation(annotation)
}

如果您还有其他问题或者这是否解决了您的问题,请告诉我