swift change background color of a view code example Example: swift change background color self.view.backgroundColor = UIColor.red