Как изменить цвет button2 в swift при нажатии кнопки1?
Все, что я хочу сделать, это изменитьbackgroundColor
из пятиMinButton и tenMinButton при нажатии на пятьMinButton. Почему этот код не работает?@IBAction
тоже не сработает.
@IBOutlet weak var fiveMinButton: UIButton!
override func viewDidLoad() {
super.viewDidLoad()
fiveMinButton.addTarget(self, action: Selector(("action:")), for: UIControlEvents.touchUpInside)
func action(sender: UIButton){
if sender === fiveMinButton {
fiveMinButton.backgroundColor = UIColor.gray
tenMinButton.backgroundColor = UIColor.lightgray
}
}