Open warmachinesocial opened 1 week ago
Hey @warmachinesocial, our SwiftUI Map is UIViewControllerRepresentable
because indeed internally it wraps a MapView
that was built with UIKit, so we reuse most of the internals between our UIKit and SwiftUI API. And we add new interfaces and mechanisms to make the SwiftUI Map feel and behave in a way similar to SwiftUI views.
Hey folks, I have been coding in swift and swiftui past a year I was looking to mapbox's library but in swiftui which wasn't there at the time. I love swiftui, but don't know the internals of it so question was why we using UIViewRepresentable? that's what I had to use last year when apple didn't support mapkit for swiftui.
Could someone explain me? It feels more like wrapper(not entirely but I have no clue on UIkit)
https://github.com/mapbox/mapbox-maps-ios/blob/e68d2e7beebed7aab1a67f4ffaf48b19ab05fc9c/Sources/MapboxMaps/SwiftUI/Map.swift#L47