In Swift, I can add map annotation and display details using segue of a dropped pin when the user clicks the "i", but I am having trouble displaying details of multiple dropped pins using segue; unlike ViewTable no index is involved here. How do I do that?
Asked
Active
Viewed 259 times
-3
-
The user can only tap one "i" so where does this "multiple" notion come from? – matt Dec 01 '15 at 03:13
1 Answers
0
Can this give you some hint?
func mapView(mapView: MKMapView!, annotationView view: MKAnnotationView!,
calloutAccessoryControlTapped control: UIControl!) {
//get the annotation ,maybe you need cast the type
// let anno = view.annotation
//performSegue here
}

ZHZ
- 2,088
- 13
- 16
-
I am already doing this and it does show the details, but my problem is it only shows the details of the last dropped pin. How do I make it pass details of the tapped pin? – Sam M. Dec 01 '15 at 03:44
-
Have you passed the selected annotation's info or something to the detail viewController – ZHZ Dec 01 '15 at 03:50
-
I am using this: self.mapItemData = localSearchResponse?.mapItems.last to assign search data to the pin, and passing the info to the segue, it works well for a single pin but don't know how to assign this for multiple pins. mapItemData is MKMapItem – Sam M. Dec 01 '15 at 03:55
-
-
-