struct Model: Convertible {
var coordinate: [[Double]] = []
}
let json = [
"coordinate": [
[1.0, 2.0],
[3.0, 4.0],
[5.0, 6.0]
]
]
let model = json.kk.model(Model.self) //model 是 Model?类型, Opetional没有JSONString()方法
print(model.kk.JSONString()) //Value of type 'KKGeneric<Model?, Model>' has no member 'JSONString'
if let model = json.kk.model(Model.self) {
print(model.kk.JSONString()) //这个正常
}