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
You can try this as well, which is really a combination of previous answers from other posters here :
let backgroundImage = UIImageView(frame: UIScreen.main.bounds)
backgroundImage.image = UIImage(named: "RubberMat")
backgroundImage.contentMode = UIViewContentMode.scaleAspectFill
self.view.insertSubview(backgroundImage, at: 0)