【发布时间】:2018-10-09 01:25:10
【问题描述】:
当我为视图控制器设置背景图像时,我遇到了一些这样的错误......
Error: Value of optional type 'UIImage?' not unwrapped; did you mean to use '!' or '?'? Insert '!'
我的代码是...
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
self.view.backgroundColor = UIColor(patternImage: UIImage(named: "image.png"))
}
【问题讨论】:
标签: ios swift cocoa-touch uiimageview uiimage