我从这里开始学习教程:https://developer.apple.com/videos/play/wwdc2019/241/
然而,我不能继续前进,因为我得到了
Use of undeclared type 'IMDFDecodableFeature'和
Use of unresolved identifier 'IMDFError'我不确定这是不是MapKit的一部分,或者教程中的人是否在他没有展示的代码中定义了这些,或者我运行swiftUI时是否存在兼容性问题。
此外,如果是兼容性问题,google地图或其他供应商是否可以渲染用户定义的室内地图?
以下是代码片段:
import Foundation
import MapKit
class Feature<Properties: Decodable>: NSObject, IMDFDecodableFeature {
let identifier: UUID
let properties: Properties
let geometry: [MKShape & MKGeoJSONObject]
required init( feature: MKGeoJSONFeature) throws {
guard let uuidString = feature.identifier else {
throw IMDFError.invalidData
}
if let identifier = UUID( uuidString: uuidString) {
self.identifier = identifier
} else {
throw IMDFError.invalidData
}
self.geometry = feature.geometry
super.init()
}
}谢谢
发布于 2020-08-02 04:35:14
我不认为这个类是MapKit的一部分。相反,它似乎是示例代码Displaying an Indoor Map的一部分。
如果您下载它并查看文件IMDFDecoder.swift,您将看到IMDFDecodableFeature和IMDFError在那里被声明。
https://stackoverflow.com/questions/63208576
复制相似问题