Before we move on, let's go ahead and alter some of the navigation bar style options. Our application will have the same navigation bar style in every view, so our best approach is to use the appearance proxy on UINavigationBar
in our AppDelegate
object. This will allow us to write the code only once, and the navigation bars in the entire application will abide by these styles.
Switch to AppDelegate.m
and scroll down to the applicationDidFinishLaunchingWithOptions
method. We are going to set the color of the navigation bar, the font for the title label, and the navigation bar tint color (this will change the color of the bar button items on the navigation bar). Additionally, our application will have text-based bar button items, so we want to set the appearance proxy on UIBarButtonItem
to match our application style. Copy and paste the following code into applicationDidFinishLaunchingWithOptions
:
[[UINavigationBar appearance] setBarTintColor:[UIColor colorWithRed:200...