Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var window: UIWindow?
- func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool
- {
- var tabbar = UITabBarController()
- let storyboard = UIStoryboard(name: "Main", bundle: nil)
- let HomeVC : ViewController = storyboard.instantiateViewControllerWithIdentifier("HomeVC") as ViewController
- HomeVC.tabBarItem.title = "Home"
- HomeVC.tabBarItem.image = UIImage(named: "home.png")
- let SettingVC : SettingViewController = storyboard.instantiateViewControllerWithIdentifier("SettingVC") as SettingViewController
- SettingVC.tabBarItem.title = "Setting"
- SettingVC.tabBarItem.image = UIImage(named: "settings.png")
- var arrayTabbar = [HomeVC,SettingVC]
- tabbar.viewControllers = arrayTabbar
- tabbar.view.autoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight
- window?.rootViewController = tabbar
- window?.makeKeyAndVisible()
- return true
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement