AZColoredNavigationBar 0.0.4

AZColoredNavigationBar 0.0.4

TestsTested
LangLanguage Obj-CObjective C
License MIT
ReleasedLast Release Dec 2014

Maintained by Unclaimed.



  • By
  • Alan Zeino

A drop–in UINavigationBar subclass which allows for strong coloured navigation bars on iOS 7.

Usage

Use with UINavigationController's initWithNavigationBarClass:toolbarClass: method:

UINavigationController *navigationController = [[UINavigationController alloc] initWithNavigationBarClass:[AZColoredNavigationBar class] toolbarClass:[UIToolbar class]];

// If you need to set a rootViewController too, then set the navigationController's viewControllers.
navigationController.viewControllers = @[ rootViewController ];

Then either set the barTintColor using UIAppearance (applied globally):

[[UINavigationBar appearance] setBarTintColor:[UIColor blueColor]];

Or if you want to change the colour dynamically:

navigationBar.barTintColor = [UIColor blueColor];

Acknowledgements

Thanks to @steventroughtonsmith for the original help as seen in this gist. Forked from @aprato's modification here.