我已经通过Cocoapods下载了'GeoJSON'吊舱。但是当我尝试运行我的应用程序时,我收到了以下错误。
错误:上下文类型“AnyObject”不能与字典文字一起使用。 (Image)
public var dictionaryRepresentation: [String: Any] {
return [
"geometry": [
"coordinates": self.geometryCoordinates,
"type": type(of: self).type
],
"type": "Feature",
"properties": [:]
]
}
答案 0 :(得分:0)
我解决了这个问题
public var dictionaryRepresentation: [String: Any] {
return [
"geometry": [
"coordinates": self.geometryCoordinates,
"type": Self.type
] as [String: Any],
"type": "Feature",
"properties": [:]
]
}