原文地址readonly properties in Swift
Turns out just like in Obj-C, in Swift it's possible to declare nicely encapsulated readonly properties.
public private(set) var foo: String
Thank you NSHipster reader Stephen Celis
原来这么简单,但好像很少人说
原文地址readonly properties in Swift
Turns out just like in Obj-C, in Swift it's possible to declare nicely encapsulated readonly properties.
public private(set) var foo: String
Thank you NSHipster reader Stephen Celis
原来这么简单,但好像很少人说
本文标题:swift中的只读属性实现,很简单
本文链接:https://www.haomeiwen.com/subject/tgvcjttx.html
网友评论