So I am making an app where the user will have to categorize their post between two options - "Lost" & "Found". Each button has the option to be clicked, but when I did the Testflight I got the comment that when they clicked the other button because they made a mistake, that the image stayed activated.
Is there a way to change the image of the other button back to the normal deselected image if the other button is clicked?
Here's my code:
var lost = Bool()
@IBOutlet weak var address: UITextField!
@IBOutlet weak var breed: UITextField!
@IBOutlet weak var phone: UITextField!
@IBOutlet weak var imagePosted: UIImageView!
@IBOutlet weak var changeImageLostButton: UIButton!
@IBOutlet weak var changeImageFoundButton: UIButton!
//BUTTONS PRESSED - LOST & FOUND
@IBAction func lostPressedButton(_ sender: UIButton) {
changeImageLostButton.setImage(UIImage(named:"LostButton-active.png"), for: .normal)
lost = true
}
@IBAction func foundPressedButton(_ sender: Any) {
changeImageFoundButton.setImage(UIImage(named:"FoundButton-active.png"), for: .normal)
lost = false
}