How can I set a background image for my main view controller in Xcode 6 using swift? I know that you can do this in the assistant editor as below:
overri
override func viewDidLoad() { super.viewDidLoad() self.view.backgroundColor = UIColor(patternImage: UIImage(named: "background.png")) }
SWIFT 4
view.layer.contents = #imageLiteral(resourceName: "webbg").cgImage