I’m trying to identify the Navigation Bar in the current view so that I can add a subview to it.
I have seen this code which is able to identify the Navigation Bar that has been dynamically created and tagged:
UINavigationBar *theNavigationBar = (UINavigationBar *)[inParent.view viewWithTag:kNavigationBarTag];
But in my case the Navigation bar is not being created dynamically, so it’s not tagged. Is there a way to identify it otherwise?
Only valid when called from a method in a UIViewController, of course. Otherwise, try to retrieve a reference to the view controller and take it from there.