ios - MapBox 安装问题

标签 ios swift xcode mapbox

我正在尝试在 Xcode 版本 10.1 上安装 MapBox SDK

到目前为止我所做的是: 创建 pod 文件

pod 'MapboxNavigation', '~> 0.29.0'

然后我将 MGLMapboxAccessTokenNSLocationWhenInUseUsageDescription 设置为文档中指定的正确凭据

然后我更新了“音频、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)
}

我的问题是旁边有很多错误和警告,我可以做些什么来摆脱它们吗?

enter image description here

我尝试使用“修复”将代码更改为推荐设置,但它只会导致更多错误

任何帮助将不胜感激

最佳答案

您可以在 Podfile 中使用这一行来消除来自 pod 的警告。不幸的是,并非所有第三方都发布无警告 pod,因此除非您想深入研究每一个警告、调整源等,否则您可能需要走这条路以获得干净的构建。

inhibit_all_warnings!

关于ios - MapBox 安装问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54812935/

相关文章:

objective-c - sqlite ios线程访问

ios - 如何使用 Graphics Context 清除具有关闭路径的任何 imageView 的图像

swift - 当child是list时按child查询过滤

xcode - 如何在 Xcode 中将 NSClickGestureRecogniser 与 Swift 一起使用?

ios - 如何在tableViewCell中获取准确的星星

iphone - 读取 ABSource 的名称

objective-c - 桥接 Objective-C header 会导致 Swift 编译器错误

ios - 自定义表格 View 单元格 : IBOutlet label is nil

ios - 我们可以在 2 个不同的配置文件中添加 iOS 设备的单个 UDID

ios - Xcode 6 GM - 无法使用 Playground