I am trying to work out how to setup a custom navigation bar with storyboards. I have added a navigation bar directly to a view controller in my app.
The VC is not directly in a Navigation Controller stack, but will appear as it is. Kind of as a main point for the application. The same navigation bar will be used through the application.
I would like to style the navigation bar throughout the application. Previously I used the following when it was within a navigation controller, but now isn't and will remain not actually in the nav stack as not required.
[[UINavigationBar appearance] setBackgroundImage:portraitImage forBarMetrics:UIBarMetricsDefault];
What is the correct way to style this now it is an item simply added to the VC? The bar will be added to other VCs too so it should be re-usable. I have tried to subclass UINavigationBar and change this in the storyboard for the Navigation Bar too but not sure how to implement the styling.
I have tried to change the drawRect method on this subclass but the changes do not take place. I cannot find any documentation directly from Apple on how to subclass this and add styling.
AppDelegate.m
indidFinishLaunchingWithOptions
method that way you can add any navigation bar to any vc