-
Notifications
You must be signed in to change notification settings - Fork 312
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SwiftUI #2264
Comments
Anyone? A tutorial would be nice on this. So far it seems you cant even install this currently because it requires a different version of MapboxMobileEvents than what MapboxSDK needs. |
There’s no tutorial yet for adding the navigation SDK into a SwiftUI application, but this is good feedback for our documentation team. In case it helps, the main entry point for the navigation SDK is NavigationViewController, so you can get up and running as long as you find a way to embed a view controller in your UI. Note that there’s a known issue with SwiftUI causing a crash in some cases: #2300.
This was #2299, which is now fixed as of v0.37.1, v0.38.2, and v1.0.0-alpha.1. If you’re getting an error from CocoaPods or Carthage about a conflicting MapboxMobileEvents dependency, you may need to modify your Podfile or Cartfile:
/cc @mapbox/docs |
I'm struggling with this problem. I don't understand how is possible to keep the navigation controller alive while the app is showing other views. |
You will need to create a SwiftUI View that represents NavigationViewController. Then you can call .sheet to open a modal (or open a new view) for the navigation. I did play a bit with it when investigating some map solutions for my company's mobile app. Just write a quick tutorial to show how to bring Mapbox navigation to iOS with SwiftUI. |
Two years later and still no SwiftUI documentation? |
@danielnordh |
Same here, how is it not here yet? |
I found this example which might be useful for others: https://github.com/mapbox/mapbox-directions-swift/tree/9714ec6451bec68ce7a753b8070a0b5664019a1c/IntegrationWithNavigationSDK/MapboxNavigationSwiftUI |
how to implement navigation in swiftUi?
The text was updated successfully, but these errors were encountered: