Dies ist die JSON-Antwort, die ich vom Server erhalte. Ich habe versucht, die Werte ohne Erfolg zu analysieren.Wie analysiert man die Werte dieser JSON-Antwort in Swift 3?
{"items":
[{"item":
{ "id":824,
"company_id":31,
"config_id":45,
"imagesmall":null,
"imagethumb":null,
"pointofsales":null,
"status":true,
"endPlanned":false
}
},
{"item":
{ "id":889,
"company_id":74,
.
.
.
"status":true,
"endPlanned":false
}
}]
}
-Code Ich versuche
if let json = try? JSONSerialization.jsonObject(with: data!, options: .allowFragments) as? [String: Any]{
print(json) // does work
let item = json?["items"] as? [[String: Any]]
print(item?[0]) // does work
// ... from here I am looking for the code to access the values and print it out ...
}
Zeigen Sie uns, was Sie versucht haben. –
Nicht hier [bearbeite deine Frage] (http://stackoverflow.com/posts/42000176/edit) mit deinem Code und was damit nicht funktioniert. –