I am trying to set aground image to my ViewController in swift language.
I am using the following code :
self.view.backgroundColor = UIColor(patternImage: UIImage(named:”bg.png")!)
But the app is getting crash.It is showing the error like
“fatal error: unexpectedly found nil while unwrapping an Optional value”(Because of the “!”)