//在window上设置窗口为UITabBarController
self.window=UIWindow(frame: UIScreen.mainScreen().bounds)
self.window!.rootViewController = UITabBarController()
self.window!.makeKeyAndVisible()
return true
//在UITabBarController的.swift文件中 创建UIViewController,并且包装成导航控制器
let SY = UIViewController() //创建
let NV = UINavigationController(rootViewController: SY) //包装
//设置导航栏标题
SY.navigationItem.title = "enenenn"
//设置TabBar标题
NV.tabBarItem.title = "首页"
//添加到TabBar
viewControllers=[NV] //这行的意思是多个控制器可以以数组的形式一次添加上去
或者
addChildViewController(NV)
-------------------------------------------------------------
//设置tabBar 栏的背景颜色
self.tabBar.barTintColor = UIColor.redColor()
//设置导航条背景颜色
NV.navigationBar.barTintColor = UIColor.redColor()