I want to pass the data (quelmonument) from a pinpoint on a Mapkit to another viewcontroller. With this code just below, i could get the good value but i don't know i could do to pass the data.
func mapView(mapView: MKMapView!, annotationView: MKAnnotationView, calloutAccessoryControlTapped control: UIControl) {
if control == annotationView.rightCalloutAccessoryView {
if let pinannotation = annotationView.annotation as? Artwork{
println("status was = \(pinannotation.quelmonument)")
var indexmonument = pinannotation.quelmonument
performSegueWithIdentifier("hugo", sender: self)
}
}
}
I have tried to send the value 2, and it's working, but instead of 2 i would like send "quelmonument" variable. Could you give me pls an hint ?
func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
if segue.identifier == "hugo"
{
if let destinationVC = segue.destinationViewController as? MonumentViewController{
destinationVC.numberToDisplay = 2
}
}
}