NGTabBarController for iOS

A custom TabBarController which can be positioned on the bottom, top, left or top. Utilizes iOS 5 Containment API if possible, but works on iOS 4 too. The TabBar is fully customizable with a tintColor or background image as well as the possibility to show/hide the item highlight and the possibility to change the text colors, have image-only tabBar items etc.
Download the source code here

NGColoredViewController *vc1 = [[NGColoredViewController alloc] initWithNibName:nil bundle:nil];
NGColoredViewController *vc2 = [[NGColoredViewController alloc] initWithNibName:nil bundle:nil];
NGColoredViewController *vc3 = [[NGColoredViewController alloc] initWithNibName:nil bundle:nil];
NGColoredViewController *vc4 = [[NGColoredViewController alloc] initWithNibName:nil bundle:nil];
NGColoredViewController *vc5 = [[NGColoredViewController alloc] initWithNibName:nil bundle:nil];
 
vc1.ng_tabBarItem = [NGTabBarItem itemWithTitle:@"Home" image:image1];
vc2.ng_tabBarItem = [NGTabBarItem itemWithTitle:@"Images" image:image2];
vc3.ng_tabBarItem = [NGTabBarItem itemWithTitle:@"Live" image:image3];
vc4.ng_tabBarItem = [NGTabBarItem itemWithTitle:@"Contact" image:image4];
vc5.ng_tabBarItem = [NGTabBarItem itemWithTitle:@"Settings" image:image5];
 
NSArray *viewController = [NSArray arrayWithObjects:vc1,vc2,vc3,vc4,vc5,nil];
 
NGTabBarController *tabBarController = [[NGTestTabBarController alloc] initWithDelegate:self];
 
tabBarController.animation = NGTabBarControllerAnimationMoveAndScale;
tabBarController.layoutStrategy = $isPhone() ? NGTabBarLayoutStrategyEvenlyDistributed : NGTabBarLayoutStrategyCentered;
tabBarController.itemPadding = 10.f;
tabBarController.showsItemHighlight = NO;
tabBarController.tintColor = [UIColor redColor];
tabBarController.viewControllers = viewController;
self.window.rootViewController = tabBarController;

NGTabBarController was created by Matthias Tretter (@myell0w).

Leave a Comment