UIView background color in Swift
问题 Is there a way to set the UIView background color with Swift? I know that in Objective-C, you would use self.view.backgroundColor = [UIColor redColor]; , but that does not work the same way in Swift. I have looked around and because Swift is only about a week old, I cannot find an answer. Does anyone have any suggestions? 回答1: self.view.backgroundColor = UIColor.redColor() In Swift 3: self.view.backgroundColor = UIColor.red 回答2: Try This, It worked like a charm! for me, The simplest way to