KCExplodeTabBar 0.1.2

KCExplodeTabBar 0.1.2

TestsTested
LangLanguage Obj-CObjective C
License MIT
ReleasedLast Release Oct 2015

Maintained by Kevin Yufei Chen.



  • By
  • Kevin Yufei Chen

Screenshots

demo screenshot

Documentation

Click here for full documentation.

Demo

To run the example project, clone the repo, and run pod install from the Example directory first.

Usage

#import <KCExplodeTabBar/KCExplodeTabBarController.h>

self.explodeTabBarController = [[KCExplodeTabBarController alloc] init];
  • Style

The title under each tab can be set hidden or not.

self.explodeTabBarController.titleHidden = NO;

You can customize the border width and the border color of each tab and the main tab. Use the init method in UITabBarItem’s category to create a UITabBarItem object with additional information and set it to your view controller.

UITabBarItem *tabBarItem = [[UITabBarItem alloc] initWithTitle:@"Demo" 
                                                         image:[UIImage imageNamed:@"TabBarImage"] 
                                                 selectedImage:[UIImage imageNamed:@"SelectedTabBarImage"] 
                                                   borderWidth:1.0 
                                                   borderColor:[UIColor redColor]];
self.demoViewController.tabBarItem = tabBarItem;

There will be no border if you use the UITabBarItem's default init.

To set the border width for the main tab, simply do

self.explodeTabBarController.mainTabBorderWidth = 2.0;
  • Tabs

The view controller displayed by KCExplodeTabBar by default does not have to be the first one. You can change it by changing the value of defaultViewControllerIndex.

self.explodeTabBarController.defaultViewControllerIndex = 1;

Add your view controllers just like a normal UITabBarController.

[self.explodeTabBarController setViewControllers:@[firstNavigationController, secondNavigationController, ...]];

Finally, display your KCExplodeTabBar just like you do with a normal UITabBarController (this depends on how you set up your navigation controller). See the demo for a possible way to do that.

[self.navigationController setViewControllers:@[self, self.explodeTabBarController] animated:NO];
  • More Customization

You can always implement your own tab bar controller by adopting KCExplodeTabBarDataSource and KCExplodeTabBarDelegate.

#import <KCExplodeTabBar/KCExplodeTabBar.h>

Installation

KCExplodeTabBar is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "KCExplodeTabBar"

Author

Kev1nChen (Kevin Yufei Chen)

License

KCExplodeTabBar is available under the MIT license. See the LICENSE file for more info.