I want to change the color of UIbuttons but problem is that I have tried changing color in
@IBAction func buttonPressed(_ sender: UIButton) {
sender.backgroundColor = .red
}
it is not doing anything but on the same time some other buttons are changing colors on this method. I am really confused about this behaviour that some buttons are changing color on same method others don't.
I've also tried @IBOutlet method and it also didn't worked
@IBOutlet weak var button: UIButton!
and then change the color of button in method
button.backgroundColor = .red
Even setting text or color of the in viewDidLoad not working. It is showing the same button as it is designed in storyboard