In the screenshot posted below, the cook, buyer and both are UIButton
. User can click any one button. If one button is pressed, the button background color changes to green. After that when user clicks the register button, how do I check if the UIButton
color is green or not. At least one UIButton
has to be selected in order for the user to register.
I changed the button background color using this code:
@IBAction func cookact(_ sender: Any){
cookbtn.backgroundColor = UIColor.green
}
How do I check if a button has been pressed?