【发布时间】:2021-01-27 04:27:53
【问题描述】:
基本上我想采用以下 JSON 并在我的项目中使用数据。
为了解析数据,我需要创建一个结构 - 过去我将它用于数组:
结构:
struct ArrayStruct: Codable {
let info1: String
let info2: String
}
数组:
[
{
"info1": "Information",
"info2": "More"
}
]
以下数据的结构是什么样的?
{
"error": false,
"response": "",
"message": "",
"general": {
"customer": "Customer1",
"code": "CO1234",
"name": "Machine Name",
"category": "machine"
},
"details": {
"taken": "July 15th 2020",
"created": "November 2nd 2020",
"packed": "",
"delivered": ""
}
}
【问题讨论】:
-
你肯定尝试过什么?