Skip to content
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

Open
vasquezdennisalon opened this issue Nov 5, 2019 · 8 comments
Open

SwiftUI #2264

vasquezdennisalon opened this issue Nov 5, 2019 · 8 comments

Comments

@vasquezdennisalon
Copy link

how to implement navigation in swiftUi?

@1ec5 1ec5 changed the title Navigation SwiftUI Dec 27, 2019
@CodyPChristian
Copy link

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.

@1ec5
Copy link
Contributor

1ec5 commented Jan 14, 2020

A tutorial would be nice on this.

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.

So far it seems you cant even install this currently because it requires a different version of MapboxMobileEvents than what MapboxSDK needs.

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:

  • Navigation SDK v0.37.x and v0.38.x require map SDK v5.5.x.
  • Navigation SDK v1.0.0-alpha.1 requires map SDK v5.6.x.

/cc @mapbox/docs

@ghost
Copy link

ghost commented Feb 26, 2020

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.

@tudatn
Copy link

tudatn commented Apr 25, 2020

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.

@danielnordh
Copy link

Two years later and still no SwiftUI documentation?
For any new app this would be the default.

@arshmeets
Copy link

@danielnordh
Completely agree. I have been struggling to use the SDK for the last two weeks and the lack of up to date guides or tutorials is ridiculous. It seems that almost all major SDK's have support for SwiftUI or even guides made by others, but there is simply no support for this and it is encouraging me to quit on using this SDK. If I figure it out, I will be sure to post my project in here.

@haydgately
Copy link

Same here, how is it not here yet?

@treacher
Copy link

treacher commented Jul 17, 2023

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants