MaterialTabBar 0.2.3

MaterialTabBar 0.2.3

TestsTested
LangLanguage SwiftSwift
License MIT
ReleasedLast Release Nov 2020
SPMSupports SPM

Maintained by Michal Rentka.



  • By
  • Michal Rentka

MaterialTabBar

Version License Platform

MaterialTabBar

A simple and customizable tab bar controller which imitates the Material design. You can customize the position of the tab bar, selection type, content of each tab, colors, fonts, etc. Changes to the tab bar can also be animated with UIKit.

Usage

Import MaterialTabBar at the top of the Swift file of your custom tab bar controller and all child controllers. Subclass the TabBarController and set child view controllers in viewDidLoad method.

import MaterialTabBar

class MyTabBarController: TabBarController {
    override func viewDidLoad() {
        super.viewDidLoad()
        
        let childControllers = [...]
        self.setViewControllers(childControllers, animated: false)
    }
}

Each child controller needs to implement the TabBarChildController protocol which makes the tabItem available. In the tabItem you can specify the content that is shown in tab for this controller.

import MaterialTabBar

class MyChildViewController: UIViewController, TabBarChildController {
    var tabItem: TabBarItem
}

Example

To run the example project, clone the repo, and run pod install from the Example directory first. In the example project you can see how the MaterialTabBar can be used.

Installation

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

pod 'MaterialTabBar'

Author

Michal Rentka, [email protected]

License

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