Reputation: 527
I'm basically trying to detect when an annotation is unselected. So when you either click on another annotation and change the currently selected one or when you tap just on the map and it unselects it.
Upvotes: 0
Views: 406
Reputation: 9915
There is a delegate method for this. Just make sure you set the delegate
property of the map view to the containing view controller.
optional func mapView(_ mapView: MKMapView, didDeselect view:
MKAnnotationView)
This link may help you: https://developer.apple.com/documentation/mapkit/mkmapviewdelegate
Upvotes: 1