swift中懒加载的写法,直接上例子 (懒加载一个遮罩视图)
lazy var dummyView: UIView = { let v = UIView() v.backgroundColor = UIColor(white: 0.0, alpha: 0.2) return v }()
本文共 227 字,大约阅读时间需要 1 分钟。
swift中懒加载的写法,直接上例子 (懒加载一个遮罩视图)
lazy var dummyView: UIView = { let v = UIView() v.backgroundColor = UIColor(white: 0.0, alpha: 0.2) return v }()
转载于:https://www.cnblogs.com/haojuncong/p/4504224.html