I am new to the swift language. Can someone tell me how to change the background color of a button using the swift language?
button.backgroundColor = UIColor.blue
Or any other color: red
, green
, yellow
,etc.
Another option is RGBA color:
button.backgroundColor = UIColor(red: 0.4, green: 1.0, blue: 0.2, alpha: 0.5)