override func viewDidLoad()
{
super.viewDidLoad()
self.navigationController?.navigationBar.barTintColor = UIColor(red: 0, green: 0, blue: 0, alpha: 1.0)
let attr: NSMutableDictionary! = [NSForegroundColorAttributeName: UIColor.whiteColor()]
UINavigationBar.appearance().titleTextAttributes = attr
self.view.backgroundColor = UIColor.whiteColor()
}
It is said that
'Cannot assign value of type 'NSMutableDictionary!' to type '[String : AnyObject]?''
on this line
UINavigationBar.appearance().titleTextAttributes = attire
and if I change it to
UINavigationBar.appearance().titleTextAttributes = attr as! [String: AnyObject]
Although it has no error, but it can change the text's color. Why?