我有些困扰。 我想在导航栏标题中使用图像,但是我遇到了一个错误,即“UIImage”不是“NSString”的子类型。 请查看以下代码:
class Dashboard: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
self.navigationItem.title = UIImage(named: "logo.png")
// Do any additional setup after loading the view.
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
}
有人能提出建议吗?谢谢!