Advertisement
Guest User

Untitled

a guest
Feb 26th, 2015
221
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. var window: UIWindow?
  2.  
  3.  
  4. func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool
  5. {
  6. var tabbar = UITabBarController()
  7. let storyboard = UIStoryboard(name: "Main", bundle: nil)
  8.  
  9. let HomeVC : ViewController = storyboard.instantiateViewControllerWithIdentifier("HomeVC") as ViewController
  10. HomeVC.tabBarItem.title = "Home"
  11. HomeVC.tabBarItem.image = UIImage(named: "home.png")
  12.  
  13. let SettingVC : SettingViewController = storyboard.instantiateViewControllerWithIdentifier("SettingVC") as SettingViewController
  14. SettingVC.tabBarItem.title = "Setting"
  15. SettingVC.tabBarItem.image = UIImage(named: "settings.png")
  16.  
  17. var arrayTabbar = [HomeVC,SettingVC]
  18.  
  19. tabbar.viewControllers = arrayTabbar
  20. tabbar.view.autoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight
  21. window?.rootViewController = tabbar
  22. window?.makeKeyAndVisible()
  23. return true
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement