Why is the UINavigationBar title text not changing color?

I have just downloaded Xcode 11.4 and noticed that I am unable to change the title text color for my UINavigationBar in the storyboard. I tried to change it within the code as so:


navigationController?.navigationBar.titleTextAttributes = [ NSAttributedString.Key.foregroundColor : UIColor.white ]


However, this line of code was unable to change the color. Why has this suddenly occurred in Xcode 11.4? Is this a known issue? How can I work around it?

Replies

Didn't you see the answer a few posts below ?

https://forums.developer.apple.com/thread/130597

On the storyboard, for your Navigation Controller change the "Bar Tint" to its "Default" value, then on your code you can change it as you normally would.


Doesn't it work for you ?

Ok, thank you for pointing that out to me. I must have missed that in the post. I was trying out the "correct answer" but that does not involve changing the bar tint to default.


Also, It worked like it should, however, my status bar now has a white background. Why is that and how do I fix it?

I did not see the problem mentioned in the other post.


Did you try setting the attribute for backGroundColor as well ?

The trick to use the defaul bar tint color only works if you tick "prefer large titles". Normal sized bar don't get the background color.