class CustomTabBarViewController: UIViewController, TabNavigable {
var containerView: UIView!
var viewControllers: [UIViewController]! = []
override func viewDidLoad() {
super.viewDidLoad()
initViewControllers()
}
private func initViewControllers() {
addViewController()
addViewController()
addViewController()
changeActiveViewController(index: 0)
}
private func addViewController() {
let viewController = YourTabViewController()
viewControllers.append(viewController)
}
func tabButtonDidTap(index: Int) {
changeActiveViewController(index: index)
}
}
TabNavigable is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "TabNavigable"
For your convenience, execute the line below to generate xcodeproj.
$ swift package generate-xcodeproj
Wooseong Kim, innocarpe@gmail.com
TabNavigable is available under the MIT license. See the LICENSE file for more info.