lazy code
hanks-hu opened this issue · comments
hanks-hu commented
lazy var tableView: UITableView = {
let tabView =UITableView.init(frame: .zero, style: .plain)
tabView.backgroundColor = UIColor.white
tabView.dataSource = self
tabView.delegate = self
return tabView
}()
I often use lazy loading, and,how to write by Then。Can you give me a test code。
Suyeol Jeon commented
Doesn't it work?
lazy var tableView = UITableView(frame: .zero, style: .plain).then {
$0.backgroundColor = UIColor.white
$0.dataSource = self
$0.delegate = self
}
hanks-hu commented
Sergey Pugach commented
@devxoul Hi, sorry to bother you. Any updates about Carthage support?
LΞO commented
@HanksHu
did your Xcode give you the hint now?
hanks-hu commented
@iTofu sorry.
use let
, give me hints.
let orderNumLabel = UILabel().then {
}
but,use lazy var
, Don't give me hints.
lazy var orderNumLabel = UILabel().then {
$0.textColor = UIColor.init(hex: "b7b7b7")
$0.numberOfLines = 1
}
LΞO commented
@HanksHu
fine and thank you :(
WangYang commented
@HanksHu
me too
use let
, give me hints. use lazy var
, Don't give me hints.