Setting the Navigation and Status Bar text colour

swift, xcode

Solution

`UITextAttributeTextColor` is deprecated; you need to use `NSForegroundColorAttributeName` instead.

Problem

I am trying to change the text colour of the navigation bar in my app, however I can't figure out how it's done. Prior to Xcode 6 beta 2 I was using: ``` navigationController.navigationBar.titleTextAttributes = [UITextAttributeTextColor: UIColor.whiteColor()] ``` And that worked absolutely fine but after updating to the newer versions I just get an error stating that 'titleTextAttributes' is not available in Swift. Also, how can I change the text colour of the status bar? I've tried changing it in the Attributes inspector and I have also tried doing it via code by following Objective C examples, but I still cannot get it to work.

Original source