Ios Swift 3.0注释标注
是否有办法在ViewDid出现时取消注释标注?例如,如果单击注释,则会显示详图索引。但是,将视图控制器切换回地图视图将返回标注仍在其中的注释。我对能够取消标注感兴趣,但我知道这需要操纵annotationView,我不确定如何将其合并到ViewDidAppeare中 在您的Ios Swift 3.0注释标注,ios,swift,annotations,viewdidappear,Ios,Swift,Annotations,Viewdidappear,是否有办法在ViewDid出现时取消注释标注?例如,如果单击注释,则会显示详图索引。但是,将视图控制器切换回地图视图将返回标注仍在其中的注释。我对能够取消标注感兴趣,但我知道这需要操纵annotationView,我不确定如何将其合并到ViewDidAppeare中 在您的视图中使用此代码 我们在选定的注释上循环,并在每个注释上调用deselect for annotation in self.mapView.selectedAnnotations { self.
视图中使用此代码
我们在选定的注释上循环,并在每个注释上调用deselect
for annotation in self.mapView.selectedAnnotations
{
self.mapView.deselectAnnotation(annotation, animated: true)
}
希望这有助于在您的视图中使用此代码
我们在选定的注释上循环,并在每个注释上调用deselect
for annotation in self.mapView.selectedAnnotations
{
self.mapView.deselectAnnotation(annotation, animated: true)
}
希望这有帮助