2017-06-17 7 views
0

Cocoapods経由で 'GeoJSON'ポッドをダウンロードしました。しかし、私は私のアプリを実行しようとすると、私は次のエラーを受け取る。Swift 3 - エラー 'コンテキストタイプ' AnyObject 'を辞書リテラルで使用できません'

エラー:コンテキストタイプ 'AnyObject'は辞書リテラルでは使用できません。 (Image)

public var dictionaryRepresentation: [String: Any] { 
     return [ 
      "geometry": [ 
       "coordinates": self.geometryCoordinates, 
       "type": type(of: self).type 
      ], 
      "type": "Feature", 
      "properties": [:] 
     ] 
    } 

答えて

0

私はこの

public var dictionaryRepresentation: [String: Any] { 
     return [ 
      "geometry": [ 
       "coordinates": self.geometryCoordinates, 
       "type": Self.type 
      ] as [String: Any], 
      "type": "Feature", 
      "properties": [:] 
     ] 
    } 
のようにそれを解決しました
関連する問題