hi i'm trying to change the button's title/text with swift 5.i found some codes on StackOverflow but none of them works.
(您好,我想用swift 5更改按钮的标题/文本。我在StackOverflow上找到了一些代码,但是它们都不起作用。)
this is my code: (这是我的代码:)
func updateUI(){
storyLabel.text = storyBrain.getStory()
choice1Button.setTitle("Button Title", for: .normal)
}
but the button's title doesn't change.
(但按钮的标题不变。)
I'm pretty sure that button is connected to my controller because I can change its color (我很确定该按钮已连接到控制器,因为我可以更改其颜色)
ask by couri_g translate from so 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…