I am allowing users to create an annotation on a MKMapView
. I want the title of the annotation to be: "Directions to Here"
. And when the user taps on the title, I want the Maps app to open and display the point so that the user can get directions.
My code for creating the annotation is here:
var annotation = MKPointAnnotation()
annotation.coordinate = location
annotation.title = "Directions to Here"
annotation.title. //Not sure what to put here to make the title a button
annotations.append(annotation)
map.addAnnotation(annotation)