Basically, I have three buttons on the main screen.
When I select one of these buttons, I would like the text on the selected button to change to bold and change color (blue).
When I select another button, I would like the newly selected button to change to bold and change color (blue), and the previously selected button to return to normal. (non-greasy and black text)
I have these buttons sending an action to a script.
This is what I have, I canβt make it work. Help would be greatly appreciated!
@IBAction func buttonOne(sender: UIButton){ sender.setTitleColor(UIColor.blueColor(), forState: UIControlState.Highlighted) }
I tried .Highlighted and .Selected on UIControlState, it does not seem to work. I also tried the following, but I can't get it to work.
@IBAction func buttonOne(sender: UIButton){ sender.titleLabel?.textColor = UIColor.blueColor() }
I realized that since the sender was UIButton, and it was the button that was pressed, removing the values ββfrom it, and resetting them will work. I believe something is missing.
thanks
source share