Customizing Navigation Bar in Interface Builder

Customizing the Navigation Bar in Interface Builder (specifically customizing both the bar's background color and the title text color) seems to have become very buggy in iOS 13.


Here is a video fo me trying to do it in Interface Builder:

https://youtu.be/fQPjKv0yrk8


Long story short, if you set both the navigation bar's tint and title color, the title color is ignored.


Using the navigation bar's background color (from superclass UIView) instead seems to be buggy too. Is there a definitive answer of how to approach customizing navigation bars? Or have they just become buggy, and hacky solutions are necessary?

Replies

This has been noticed several times.


I assume you saw and tried this:

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

I had seen that, and the second link. Unfortunately they do not give me a solution to my problem.


To go into what I've tried in more detail:


If I set the navigation bar tint color to default in the storyboard, and then set the barTintColor of the navigation bar to the desired color in viewDidLoad, with:

navigationController?.navigationBar.barTintColor  = .yellow

...this does work for a regular title, but does not work for a large title. (the background does not change color)


If instead I go with an even more hacky solution of changing the backgroundColor of the navigation bar to the desired color in viewDidLoad, with:

navigationController?.navigationBar.backgroundColor  = .yellow

...with large titles, this does not affect the color of the status bar. With regular titles, the navigation bar has a strange gradient effect.


Does anyone know if this is an undocumented bug in the current version of Xcode which will be ironed out in the next version or whether we do need to find some sort of hacky solution to this strange problem?

Update: this seems to have been a problem in Xocde 11.4 and is said to have been resolved in Xcode 11.4.1:


Quote from Xcode 11.4.1 Release Notes:


> Interface Builder

> Fixed an issue that caused some UINavigationBar appearance properties set in storyboard and XIB documents to be ignored when building with Xcode 11.4. (60883063) (FB7639654)


However - the problem I described above does not seem to have been resolved for me!

Did you try with XCode 11.4.1.


Release notes say:

Interface Builder

Fixed an issue that caused some

UINavigationBar 
appearance properties set in storyboard and XIB documents to be ignored when building with Xcode 11.4. (60883063) (FB7639654)


May be that solved your issue as well ?