CocoaPods trunk is moving to be read-only. Read more on the blog, there are 17 months to go.

ZHTabBarController 0.1.4

ZHTabBarController 0.1.4

TestsTested
LangLanguage SwiftSwift
License MIT
ReleasedLast Release Mar 2017
SwiftSwift Version 3.0
SPMSupports SPM

Maintained by Zhihui Long.



  • By
  • zhihuilong

ZHTabBarController

An alternative for UITabBarController,which support all kinds of Custom TabBarController.

Requirements

Compatible with Xcode 8.2 / Swift 3.0

Installation

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

platform :ios, '8.0'
use_frameworks!

pod "ZHTabBarController"

Basic usage

1.Import ZHTabBarController module.

Swift:

import ZHTabBarController

Obj-C:

@import ZHTabBarController;

2.Make sure your AppDelegate confirm ZHTabBarControllerProtocol and implement two computing variables.

var childViewControllers: [UIViewController] { get }
var items: [ZHItemData] { get }

3.Replace the default ‘applicationDidFinishLaunching(_ application: UIApplication)’ method.

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
    window = UIWindow(frame: UIScreen.main.bounds)
    let vc = ZHTabBarController()
    vc.delegate = self
    window!.rootViewController = UINavigationController(rootViewController: vc)
    window!.makeKeyAndVisible()
    return true
}

Customization

You can customize following UI properties,

  1. tabBayStyle
  2. tabBarHeight
  3. tabBarColor
  4. tabBarItemTitleColor
  5. tabBarItemSelectedTitleColor
let vc = ZHTabBarController(style: .Default, tabBarHeight: 44)
vc.tabBarColor = UIColor.white
vc.itemTitleColor = UIColor.black
vc.itemSelectedTitleColor = UIColor.black

Todo

  • [x] Travis CI
  • [ ] Code Coverage
  • [ ] Cocoadocs
  • [ ] Snapshot
  • [ ] Support more styles
  • [ ] Carthage support

Author

Zhihui, [email protected]

License

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