0

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.

Rashwan L
  • 38,237
  • 7
  • 103
  • 107
Sam M.
  • 1
  • 2

1 Answers1

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