在AppDelegate当中写
let one = oneViewController()
let nav1 = UINavigationController(rootViewController: one)
nav1.tabBarItem = UITabBarItem(title: "呵呵", image: UIImage(named: ""), tag: 1)
let er = erViewController()
let nav2 = UINavigationController(rootViewController: er)
nav2.tabBarItem = UITabBarItem(title: "哈哈", image: UIImage(named: ""), tag: 1)
let tbv = UITabBarController()
tbv.viewControllers = [nav1,nav2]
self.window?.rootViewController = tbv
网友评论