UIButton set background color swift code example
Example 1: set color for uibutton programmatically swift
button.setTitleColor(.red, for: .normal)
Example 2: button color swiftui
Button(action: {self.buttonTapped()}) {
Text("Button")
.padding(.all, 12)
.foregroundColor(.white)
.background(Color.red)
}