2 개의 주석이있는지도가 있으며 각각에 2 개의 다른 이미지가 필요합니다.Swift를 사용하여 이미지를 MKAnnotation으로 변경하는 방법
하나의 주석을 사용하여이를 수행하는 방법을 알고 있지만 두 가지 주석이 있습니다.
여기에 하나 내 코드입니다 :
func mapView(mapView: MKMapView, viewForAnnotation annotation: MKAnnotation) -> MKAnnotationView? {
let reuseId = "pin"
var anView = mapView.dequeueReusableAnnotationViewWithIdentifier(reuseId)
anView = MKAnnotationView(annotation: annotation, reuseIdentifier: reuseId)
anView!.image = nil;
anView!.image = UIImage(named:"destinationPin")
return anView
}
그리고 당신은 reuseId 무엇인지 설명해 경우 누군가가 정말 고맙겠 할 수있는 경우에
. 지도에 주석을 추가 할 때 사전
두 개의 특수 효과를 의미합니까? 2 개의 별도 강의? – sdasdadas
지도에 두 개의 핀이 있는데 각기 서로 다른 이미지를 갖고 싶습니다. –