import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
varwindow:UIWindow?
funcapplication(_application:UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey:Any]?) ->Bool{
// Override point for customization after application launch.
//实例化控制器
letmovieVC =MovieViewController()
//给控制器添加导航标题
movieVC.navigationItem.title="影讯资讯"
//实例化导航
letmovieNav =UINavigationController.init(rootViewController: movieVC)
//登录注册模块
letloginVC =LoginViewController()
loginVC.navigationItem.title="登录"
letloginNav =UINavigationController.init(rootViewController: loginVC)
//新闻模块
letnewsVC =NewsViewController()
newsVC.navigationItem.title = "新闻"
letnewsNav =UINavigationController(rootViewController: newsVC)
//标签栏控制器
lettabCtl =UITabBarController()
tabCtl.viewControllers= [movieNav,loginNav,newsNav]
//设置标签栏标签
movieNav.tabBarItem=UITabBarItem(tabBarSystemItem:UITabBarSystemItem.contacts, tag:100)
loginNav.tabBarItem=UITabBarItem(title:"登录", image:nil, tag:101)
newsNav.tabBarItem=UITabBarItem(tabBarSystemItem: .favorites, tag:102)
//设置窗口的根视图控制器
self.window?.rootViewController= tabCtl
return true
}