I need to know how to fetch the title of a dropped pin. I have multiple dropped pins on the map, when the pin is tabbed I want to fetch the title to pass to prepareForSegue
. I use this statement "let title = self.pointAnnotation.title" via (MKPointAnnotation
) but I get the title of the last dropped pin and not the tabbed pin.
Asked
Active
Viewed 42 times
0
1 Answers
0
An easy and reliable way to get a reference to the annotation that was tapped is to use the map view's selectedAnnotations array: if let ann = self.mapView.selectedAnnotations[0] as? MKAnnotation { println("(ann.title!)") }

Sam M.
- 1
- 2