2

I have this function:

func mapView(mapView: MKMapView!, annotationView view: MKAnnotationView!, calloutAccessoryControlTapped control: UIControl!) {

    performSegueWithIdentifier("mapToCity", sender: self)
    var title = view.annotation.title
    var subtitle = view.annotation.subtitle
    var lat = view.annotation.coordinate.latitude
    var lng = view.annotation.coordinate.longitude
    var image = view.annotation.image
}

And I declared the annotation this way:

            var marker = CustomPointAnnotation()
            marker.coordinate = CLLocationCoordinate2D(latitude: lat.doubleValue, longitude: lng.doubleValue)
            marker.title = title.string
            marker.subtitle = subtitle.string
            marker.imageName = "marker.png"
            marker.image = "Test";
            mapView.addAnnotation(marker)

But the problem is that I can't call the variable view.annotation.image because the member image does not exist. So how do I add the member image so I can use that too?

Sinan Samet
  • 6,432
  • 12
  • 50
  • 93
  • Check out this if it helps http://stackoverflow.com/questions/28225296/how-can-i-add-a-button-to-mkpointannotation/28226174#28226174 – Talha Q Aug 06 '15 at 19:11
  • No that's not really what I want unfortunately. It just shows how to add a button but what I want is to add extra information like `view.annotation.rate` `view.annotation.height` etc. – Sinan Samet Aug 07 '15 at 08:43

0 Answers0