6
let loginRegisterButton:UIButton = {
let button = UIButton(type: .system)
button.backgroundColor = .white
button.setTitle("Register", for: .normal)
button.translatesAutoresizingMaskIntoConstraints = false
button.setTitleColor(.white, for: .normal)
return button
}()
是这个变量或函数,它为什么返回值?我们为什么称它?没有parenthesis
,这是行不通的,为什么?带有大括号和圆括号的块如何工作?
谢谢,有道理 – Ninja13
@忍者13欢迎您!如果您不需要进一步的帮助,请点击旁边的灰色复选标记,考虑接受答案。这会让其他人知道你的问题已经解决,并在Stack Overflow上为你赢得新的徽章。 – dasblinkenlight