I'm using this extension
extension MKMapView {
func removeAnnotationAndOverlay(annotation: MKAnnotation) {
removeAnnotation(annotation)
if overlays.count > 0 {
if let overlay = overlays.first {
removeOverlay(overlay)
}
}
}
func removeAllOverlays() {
removeOverlays(overlays)
}
func removeAllAnnotations() {
removeAnnotations(annotations)
}
func removeAllAnnotationsAndOverlays() {
removeAllOverlays()
removeAllAnnotations()
}
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…