I just want to handle a tap on MapAnnotation in Map.
I've already tried to use usual .onTap modifier, but it didn't work on content passed into MapAnnotation initializer. Also, as I understand, there is no modifier to do something like MKMapViewDelegate.mapView(_ mapView: MKMapView, didSelect view: MKAnnotationView) does.
So, is there a convenient way to handle a tap, or should I create my own UIViewRepresentable for MKMapView with its own coordinator and do whatever I want with it by interfacing with UIKit?
I've already tried to use usual .onTap modifier, but it didn't work on content passed into MapAnnotation initializer. Also, as I understand, there is no modifier to do something like MKMapViewDelegate.mapView(_ mapView: MKMapView, didSelect view: MKAnnotationView) does.
So, is there a convenient way to handle a tap, or should I create my own UIViewRepresentable for MKMapView with its own coordinator and do whatever I want with it by interfacing with UIKit?