标签: arrays swift generics
struct BaseResponse<T:Decodable>: Decodable { var code : Int var status : String var message : String var data : T? }
这是我的基本回答课。
一些时间响应来自具有多个对象的数组,而一些时间来自“数据”键中的字典。
我想使数据键动态地接受当前只接受字典的数组和字典。
可以动态化吗?
答案 0 :(得分:0)
struct BaseResponse<T:Decodable>: Decodable { var code : Int var status : String var message : String var data : T? var datas: [T]? }
我的项目