Вы не добавили код в свой вопрос, поэтому я даю вам пример кода.
Используйте этот метод делегата viewForAnnotation
для пользовательских контактов.
func mapView(mapView: MKMapView!, viewForAnnotation annotation: MKAnnotation!) -> MKAnnotationView! {
if annotation is MKUserLocation {
//return nil so map view draws "blue dot" for standard user location
return nil
}
var pinView = mapView.dequeueReusableAnnotationViewWithIdentifier("pin")
if pinView == nil {
pinView = MKAnnotationView(annotation: annotation, reuseIdentifier: "pin")
pinView!.canShowCallout = true
//Set your image here
pinView!.image = UIImage(named: "mappin")
var calloutButton = UIButton.buttonWithType(.DetailDisclosure) as! UIButton
pinView!.rightCalloutAccessoryView = calloutButton
}
else {
pinView!.annotation = annotation
}
return pinView
}
Надеюсь, это поможет.
ОК .. а затем как добавить его к картеку? Я использовал только метки места для работы. –
Следуйте этому руководству: http://www.raywenderlich.com/90971/introduction-mapkit-swift-tutorial, это поможет вам. –