小编Adi*_*ava的帖子

在swift 4中创建一个包含Array和Dictionary的字典

我只想创建一个API JSON结构.以下是帖子正文键和对象.是否有任何方法,如带有键的对象和类似于Swift 4中的Objective C的值?

{
    "name": "switch 1",
    "type": "Switch",
    "gatewayId":515,
    "serialKey": "98:07:2D:48:D3:56",
    "noOfGangs": 4,
    "equipments": [
        {
            "name": "light",
            "type": "Light",
            "port": "1"
        },
        {
            "name": "television",
            "type": "Television",
            "port": "3"
        }
    ]
}
Run Code Online (Sandbox Code Playgroud)

json nsdictionary nsarray ios swift

7
推荐指数
2
解决办法
2万
查看次数

标签 统计

ios ×1

json ×1

nsarray ×1

nsdictionary ×1

swift ×1