Before I upgraded XCode to version 7.3.1 (7D1014), the following code snippet changed background of my application.
class InitialViewController: UIViewController {
@IBOutlet weak var startImage: UIImageView!
override func viewDidLoad() {
super.viewDidLoad()
self.view.backgroundColor = UIColor(patternImage: UIImage(named: "FogCity")!)
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
}
The "print" function displays following:
Please help me!
Your code is correct, I tested it. I refer to this line of code:
self.view.backgroundColor = UIColor(patternImage: UIImage(named: "FogCity")!)
What you have to do is to check the name of the image "FogCity" to exactly match.