import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
? ? varwindow:UIWindow?
? ? funcapplication(_application:UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey:Any]?) ->Bool{
? ? ? ? // Override point for customization after application launch.
? ? ? ? //實(shí)例化控制器
? ? ? ? letmovieVC =MovieViewController()
? ? ? ? //給控制器添加導(dǎo)航標(biāo)題
? ? ? ? movieVC.navigationItem.title="影訊資訊"
? ? ? ? //實(shí)例化導(dǎo)航
? ? ? ? letmovieNav =UINavigationController.init(rootViewController: movieVC)
? ? ? ? //登錄注冊(cè)模塊
? ? ? ? letloginVC =LoginViewController()
? ? ? ? loginVC.navigationItem.title="登錄"
? ? ? ? letloginNav =UINavigationController.init(rootViewController: loginVC)
? ? ? ? //新聞模塊
? ? ? ? letnewsVC =NewsViewController()
? ? ? ? newsVC.navigationItem.title = "新聞"
? ? ? ? letnewsNav =UINavigationController(rootViewController: newsVC)
? ? ? ? //標(biāo)簽欄控制器
? ? ? ? lettabCtl =UITabBarController()
? ? ? ? tabCtl.viewControllers= [movieNav,loginNav,newsNav]
? ? ? ? //設(shè)置標(biāo)簽欄標(biāo)簽
? ? ? ? movieNav.tabBarItem=UITabBarItem(tabBarSystemItem:UITabBarSystemItem.contacts, tag:100)
? ? ? ? loginNav.tabBarItem=UITabBarItem(title:"登錄", image:nil, tag:101)
? ? ? ? newsNav.tabBarItem=UITabBarItem(tabBarSystemItem: .favorites, tag:102)
? ? ? ? //設(shè)置窗口的根視圖控制器
? ? ? ? self.window?.rootViewController= tabCtl
? ? ? ? return true
? ? }