// // RootTabBarViewController.swift // ParentAssistant // // Created by Cao yang on 2018/4/23. // Copyright © 2018年 HANGZHOUTEAM. All rights reserved. // import UIKit class RootTabBarViewController: UITabBarController { override func viewDidLoad() { super.viewDidLoad() let info = Story.instantiateViewControllerWithIdentifier("InformationViewControllerVC", storyName: "Main") as! InformationViewController let nav1 = setUpViewController(vc: info, title: "咨询频道", barImage: "") let nav2 = setUpViewController(vc: GrowViewController(), title: "成长", barImage: "") let my = Story.instantiateViewControllerWithIdentifier("MyViewController", storyName: "Main") as! MyViewController let nav3 = setUpViewController(vc: my, title: "个人中心", barImage: "") // Do any additional setup after loading the view. self.setViewControllers([nav1,nav2,nav3], animated: true) } private func setUpViewController(vc:UIViewController,title:String,barImage:String)->UINavigationController{ vc.tabBarItem = UITabBarItem.init(title: title, image: UIImage.init(named: barImage), selectedImage: UIImage.init(named: barImage)) vc.configTheme() let nav = UINavigationController.init(rootViewController: vc) nav.navigationBar.barTintColor = navigationColor nav.navigationBar.isTranslucent = false navigationBarHeight = nav.navigationBar.frame.height return nav } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. } /* // MARK: - Navigation // In a storyboard-based application, you will often want to do a little preparation before navigation override func prepare(for segue: UIStoryboardSegue, sender: Any?) { // Get the new view controller using segue.destinationViewController. // Pass the selected object to the new view controller. } */ }