아래 모든 주석을 제거하는 방법,하지만 내가 필요를 제거하는 4 빠른 내가 시도은 하나의 주석 (모든)
self.mapView.annotations.forEach {
if !($0 is MKUserLocation) {
self.mapView.removeAnnotation($0)
}
}
또는
func removeAllAnnotations() {
let annotations = mapView.annotations.filter {
$0 !== self.mapView.userLocation
}
mapView.removeAnnotations(annotations)
}
특정 주석을 제거하는 것입니다 며칠 전에 도움을받지 못하면서 누군가가 조언을 해줄 수 있었습니까?
array = [{annotationID: 1234, anotationTitle: "myLocation"},
{annotationID: 321, anotationTitle: "locationMy"}]
다음과 같이 당신에게
주석 배열을 귀찮게 죄송 나는
{annotationID: 1234, anotationTitle: "myLocation"}
어떻게 제거 싶어?
주석에 식별할만한 것이 있습니까? –
예, NSDictionary 형식입니다. 모든 주석은 배열에 있습니다 –
이 코드에 대한 더 많은 컨텍스트를 보여주십시오. –