0
我试图使用序列斯威夫特3 JSON,并上来短.. 这是JSON(总结):SWIFT 3 JSON序列
{
"values": [
{
"a": {
"b": "1",
"c": {
"d": 0.0
}
},
"wantThisOne": "2016-10-07T08:47:00Z"
},
{
"a": {
"b": "1",
"c": {
"d": 0.0
}
},
"notThisOne": "2016-10-07T09:05:00Z"
}
]
}
我想要的日期从 'wantThisOne' ,但不知道如何得到它... 这是尽我所能,但没有我尝试在如果让块似乎为我工作...任何人处理这样的事情?我已经看过堆栈溢出等......但超级卡住了。
NSURLConnection.sendAsynchronousRequest(request1 as URLRequest, queue: queue, completionHandler:{ (response: URLResponse?, data: Data?, error: Error?) -> Void in
do {
if let jsonResult = try JSONSerialization.jsonObject(with: data!, options: JSONSerialization.ReadingOptions.mutableContainers) as? NSDictionary {
print(jsonResult)
}
} catch let error as NSError {
print(error.localizedDescription)
}
})
@Richie欢迎伴侣:) –