Reputation: 606
I am trying to install MapBox SDK on Xcode Version 10.1
What I have done so far is: Created the pod file
pod 'MapboxNavigation', '~> 0.29.0'
I then set the MGLMapboxAccessToken
and NSLocationWhenInUseUsageDescription
to the correct credentials as specified in the documentation
I then updated the “Audio, AirPlay, and Picture in Picture” and “Location updates” to be enabled
I imported the librabries
import MapboxDirections
import MapboxCoreNavigation
import MapboxNavigation
I then added this code to make a route
let origin = Waypoint(coordinate: CLLocationCoordinate2D(latitude: 38.9131752, longitude: -77.0324047), name: "Mapbox")
let destination = Waypoint(coordinate: CLLocationCoordinate2D(latitude: 38.8977, longitude: -77.0365), name: "White House")
let options = NavigationRouteOptions(waypoints: [origin, destination])
Directions.shared.calculate(options) { (waypoints, routes, error) in
guard let route = routes?.first else { return }
let viewController = NavigationViewController(for: route)
present(viewController, animated: true, completion: nil)
}
My problem is that there are a lot of errors and warning on the side is there anything I can do to get rid of them?
I tried changing code to recommended settings using 'fix' but its only caused more errors
Any help would be appreciated
Upvotes: 0
Views: 92
Reputation: 2617
You can silence warnings from pods with this line in your Podfile
. Unfortunately not all third parties are releasing warning-free pods so unless you want to dig into each and every warning, tweak the source, etc., you may need to go this route to get a clean build.
inhibit_all_warnings!
Upvotes: 1