button change text color swift 5 code example Example: set color for uibutton programmatically swift button.setTitleColor(.red, for: .normal)