![](/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.