【发布时间】:2023-03-21 14:17:01
【问题描述】:
我从 API 返回以下 JSON。在我的数据库中,我已经在 JSON 中存储了一个列表。因此,它在 JSON 中为我们提供了一个 JSON 字符串。如何在 Swift 中将这些作为对象访问?更重要的是:如何在 JSON 中解析 JSON?
{
"checklists": [
{
"id": 1,
"account_id": 15,
"user_id": 15,
"object_id": 21,
"checklist": "[{\"title\":\"Test\",\"summary\":\"Test 12\"},{\"title\":\"Test 2 \",\"summary\":\"Test 123\"}]",
"title": "High Altitude Operations",
"type": "other",
"LastHistory": null,
"CleanArray": [
{
"title": "Test",
"summary": "Test 12"
},
{
"title": "Test 2 ",
"summary": "Test 123"
}
]
}
]
}
【问题讨论】:
标签: swift swifty-json