在didset属性观察器中管理可编码的ios swift。

问题描述 投票:0回答:1

我想使用didset属性来管理自定义的可编码数组,设置不同的dataTypes。这里ReportSortModal是

struct ReportSortModal<T:Decodable> {
    var title : String?
    var data : T?
}

鉴于 Fieldreport &amp.是两种不同的可编码结构。DustbinInspection 是两种不同的可编码结构。

错误的&代码如下。

enter image description here

ios swift struct codable decodable
1个回答
© www.soinside.com 2019 - 2024. All rights reserved.