I have three buttons that connect to the same IBAction. They all have their own out looks.
I found out how to make the button become highlighted when they are pressed and unhighlighted when the user presses another button. Is their a better way to write the code? Here is what I am using:
@IBAction func tipChanged(_ sender: UIButton) {
zeroPCTButton.isSelected = false
tenPCTButton.isSelected = false
twentyPCTButton.isSelected = false
sender.isSelected = true
}
The reason why I am asking is because I could make an application that has a thousand buttons and I don't want to brute force statements a thousands times