change uiview background color programmatically swift code example
Example 1: set color for uibutton programmatically swift
button.setTitleColor(.red, for: .normal)
Example 2: swift change background color
self.view.backgroundColor = UIColor.red