In this Swift code that I have greatly simplified for posting here:
@IBOutlet weak var outTrig: UIButton!
@IBAction func actTriggerCameras(_ sender: UIButton) {
Trig()
}
Trig(){
outTrig.backgroundColor = UIColor.systemRed
}
I attempt to change the Storyboard button's background color to give feedback to the user that touching it registered with the system. But the background color does not change in the iPhone 14 where this code is run. What do I need to do make this change show on the User Interface?
iOS 15 introduced
UIButton.ConfigurationBy default, when you add a button in Storyboard, the button Style is set to
Plain.If the style is
Plain,Gray,TintedorFilled:you have to use its
.configurationproperty to make changes:If you change the style to
Default:you can then use the "older" methods:
See Apple's docs here.