This a demo MapBox/SwiftUI app to add location marker to mapview. Also: selected locations are displayed in a SwiftUI. This is an answer to this Stackoverflow Question
Credits for the implementation of EnvironmentObject with UIViewRepresentable: Combine & UIViewRepresentable
Please follow the basic instruction to setup mapview here: Basic tutorial on how to integrate the Mapbox Maps SDK for iOS with SwiftUI.
- Xcode 11.7
- Swift 5
- Swift, SwiftUI, Combine, MapBox
- Download Zip file and unpack
- Follow basic mapbox tutorial for setup (pod install, mapbox api key, etc.)
- Open MapboxSwiftUIDemo.xcworkspace
- Run app by selecting Build button or Command + R
Public Domain