Post

Replies

Boosts

Views

Activity

SwiftUI Map() delegate access.
Greetings, I'm attempting to refactor a SwiftUI application. From: IUViewRepresentable of MapView To: SwiftUI's native Map() view. However my application has to be able to react to the user's panning and zooming. In my UIViewRepresentable version, I added MKMapViewDelagate protocol to the Coordinator class, and create mapView(_ mapView:regionDidChangeAnimated) How can assign a delegate class to the SwiftUI native version to accomplish this? I've seen some posts use an init() method to adjust the appearance of the map with MKMapView.appearance(). Turns out this has a delegate property, but assigning a delegate here does not result in the mapView:regionDidChangeAnimated method being called...
6
0
3.7k
Oct ’20