谁能告诉我什么T.Type时候我使用JSONDecoder().decode()?
我认为它是解码我编码的数据的类型
这么多的例子使用上面这样的方法
JSONEncoder().decode([People].self, from: data) ...
Run Code Online (Sandbox Code Playgroud)
如果我检查该方法的定义,我可以看到T.Type.
我知道仿制药但是什么 T.Type
只有T和T.Type有什么区别
当我们声明一些变量时,我们就像这样分配它们的类型
var someValue: Int
不是 var someValue: Int.self
什么是T.Type确切的和Type.self