0
Comment tapoter ou titre d'annotation cliquable dans la carte. Par exemple, j'ai le code:Comment avez-vous sélectionné le titre de l'annotation?
@IBOutlet var Map: MKMapView!
override func viewDidLoad() {
super.viewDidLoad()
Map.delegate = self
let location = CLLocationCoordinate2DMake(lat!, lon!)
let span = MKCoordinateSpanMake(0.1, 0.1)
let region = MKCoordinateRegion(center: location, span: span)
Map.setRegion(region, animated: true)
let annotation = MKPointAnnotation()
annotation.coordinate = location
annotation.title = "Title"
Map.addAnnotation(annotation)
}
J'essayez d'utiliser UITapGestureRecognizer
et mapView(_ mapView: MKMapView, didSelect view: MKAnnotationView)
mais il ne fonctionne pas. Peut-être que quelqu'un a des idées