UITabBar控制器获得自定义标签栏实现

选项卡栏控制器

UITabBar控制器获得了自定义标签栏实现!😎

如何使用

首先,您应该创建选项卡:

final class MainScreenTabs: ScreenTabs {
    var viewControllers: [UIViewController] {
        [
            // put your UIViewControllers here
        ]
    }
}

您可以创建一个:BaseTabBarController

let tabBarController = BaseTabBarController<MainScreenTabs>(tabBarView: AdaptiveTabBar(selectedColor: .red, unselectedColor: .blue))
addChild(tabBarController)
tabBarController.view.frame = view.bounds
view.addSubview(tabBarController.view)
tabBarController.didMove(toParent: self)

And then select the tab at any time programmatically:

tabBarController.setSelectedIndex(index: 2)

For details see the Example app.

Example

Example

GitHub

点击跳转