Skip to content

michalrentka/MaterialTabBar

Repository files navigation

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.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published