数据:
[
{ firstName: "Foo", lastName: "Bar" },
{ firstName: "John", lastName: "Doe" }
]
Run Code Online (Sandbox Code Playgroud)
如何使用 swift 数组和字典拥有这种结构?该数据显示数组内的字典,对吧?所以我建议:
var persons:Array = [Dictionary<String, String>()]
Run Code Online (Sandbox Code Playgroud)
但这给了我错误:
Cannot convert the expressions type () to type Array<T>
Run Code Online (Sandbox Code Playgroud)
有任何想法吗?