我看过问答 here about the self keyword in Swift .
self
但是,对我来说这并不能解释 .self 在下面的代码片段中 this question
.self
let attributes: [String: Any] = [kSecAttrKeyType as String:CFString.self, kSecAttrKeySizeInBits as String:numberOfBits]
什么? 自己 在这种情况下呢?
自己
Type.self 是作为值的类型。
Type.self
两者之间有区别
let s : String = "hello world"
其中string声明 s 和
s
let sometype : Any = String.self
我们将字符串类型本身指定为 价值 储存起来。那叫做 元类型 .