MapView SwiftUI With AnnotationView and Coordinator
SwiftUI is very powerful for building an interactive UI at a fast pace. However, there are a couple of limitations still there such as some native API from UIKit like MKMapView from MapKit or search bar and other UIKit API. I will provide a tutorial for making a MapView in SwiftUI by using UIViewRepresentable as well as putting callback to the SwiftUI if we have clicked the annotation.
Some quick knowledge about several items below:
- UIViewRepresentable : A wrapper for a UIKit view that you use to integrate that view…