I have subclass of UINavigationBar.
@interface MyNavigationBar : UINavigationBar
Made some changes and now want that my application NavigationController would use it:
_navigationController = [[UINavigationController alloc] initWithRootViewController:self.viewController];
[_window addSubview:[_navigationController view]];
[self.window makeKeyAndVisible];
I want that _navigationController would have MyNavigationBar
How this could be done ?
Thanks.
You have to create a xib with a
UINavaigationControllerin it. You can then select thenavigationBarin Interface Builder and change the class to your subclass ofUINavigationBar.Then to make this a little easier to instantiate I add a category to `UINavigationController like:
At the top of the class that uses it makes sure to import the category in my case it looks like
Then using it looks something like