![](/img/trans.png)
[英]How to convert a class / struct into dictionary with key different as that of property name
[英]How to assign dictionary to Struct Class
如何將字典[String: [Any]] to [FirstModel]?
A function 返回[String:[Any]]
我想將其分配給[FirstModel]
struct class?
struct FirstModel {
var name: String?
var values: [ArrayModel]?
}
struct ArrayModel {
var id: String?
var name: String?
}
您不能將[String: [Any]]
字典分配給[FirstModel]
數組。 它們是不相關的類型。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.