我希望能够在按下resetButton时更改removeButton的背景颜色。我对要做什么没有太多想法,而Google却找不到任何东西
如果我在Swift语法中做的事情不是很好,那我就对我感到陌生
谢谢
答案 0 :(得分:1)
拖动删除按钮以创建一个出口,例如
@IBOutlet weak var removeButton:UIButton!
然后在resetButton的动作中执行
removeButton.backgroundColor = .red
答案 1 :(得分:1)
您必须获得removeButton的引用。就像您为removeButton创建IBAction一样,创建removeButton的IBOutlet。然后在resetButton函数中,只需更改removeButton的背景颜色
removeButton.backgroundColor = .red