我正在尝试在 Xcode 版本 10.1 上安装 MapBox SDK
到目前为止我所做的是: 创建 pod 文件
pod 'MapboxNavigation', '~> 0.29.0'
然后我将 MGLMapboxAccessToken
和 NSLocationWhenInUseUsageDescription
设置为文档中指定的正确凭据
然后我更新了“音频、AirPlay 和画中画”和“位置更新”以启用
我导入了库
import MapboxDirections
import MapboxCoreNavigation
import MapboxNavigation
然后我添加了这段代码来制作路线
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)
}
我的问题是旁边有很多错误和警告,我可以做些什么来摆脱它们吗?
我尝试使用“修复”将代码更改为推荐设置,但它只会导致更多错误
任何帮助将不胜感激
最佳答案
您可以在 Podfile
中使用这一行来消除来自 pod 的警告。不幸的是,并非所有第三方都发布无警告 pod,因此除非您想深入研究每一个警告、调整源等,否则您可能需要走这条路以获得干净的构建。
inhibit_all_warnings!
关于ios - MapBox 安装问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54812935/