我想用多个 viaPoints 计算一条路线。
let route = SKRouteSettings()
route.startCoordinate = self.userLocation
route.destinationCoordinate = endCheckpoint.location.coordinate
route.viaPoints = viaPointsArray
SKRoutingService.sharedInstance().calculateRoute(route)
但是我不能申报SKViaPoint。类声明似乎丢失了,因为我收到“当我尝试声明变量时使用未解析的标识符‘SKViaPoint’”
有什么我想念的吗? 我记得当我在 Objective C 中工作时,我需要特别导入 SKViaPoint.h this is the old question about it
那么我应该在swift中做什么呢?
最佳答案
Swift 实现缺少一些导入(SKViaPoint 就是其中之一)。
参见 this修复问题
关于swift - 如何在 swift 中创建一个 SKViaPoint 数组 - Skobbler API,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35608609/