ios - 在 didset 属性观察者 ios swift 中管理可编码
问题描述
我想使用 didset 属性来管理自定义可编码数组以设置不同的数据类型。这里 ReportSortModal 是
struct ReportSortModal<T:Decodable> {
var title : String?
var data : T?
}
而Fieldreport
&DustbinInspection
是两种不同的可编码结构。
错误和代码如下:
解决方案
推荐阅读
- android - 使用 Android Shape Drawables 的不同主题的不同按钮颜色
- mysql - 如何使用mysql从数据库中获取特定行
- c++ - C++ 程序,将整数输入转换为字符的问题
- c# - 通过 C# 中的代码生成 .trx 文件
- sql-server - 使用 .Net Core 2.0 应用程序中的 .dacpac 文件部署数据库
- python - 字节对象中的 Python3 re.findall 出现,使用特定字节对象的串联 + 正则表达式模式作为搜索参数
- android - 相机缩放时相机人脸检测侦听器不起作用
- javascript - 如何在javascript中结合名字和姓氏?
- c# - Excel VSTO:使用单独程序集中的 ResourceDictionary
- java - 声纳规则:Lambdas 应该替换为方法引用