Skip to content

Instantly share code, notes, and snippets.

@tfrank64
Created June 8, 2014 17:32
Show Gist options
  • Star 22 You must be signed in to star a gist
  • Fork 5 You must be signed in to fork a gist
  • Save tfrank64/4cf9f0da800a427e368b to your computer and use it in GitHub Desktop.
Save tfrank64/4cf9f0da800a427e368b to your computer and use it in GitHub Desktop.
Swift UITabBar Programmatically
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: NSDictionary?) -> Bool {
// Override point for customization after application launch.
self.window = UIWindow(frame: UIScreen.mainScreen().bounds)
var nav1 = UINavigationController()
var first = FirstViewController(nibName: nil, bundle: nil)
nav1.viewControllers = [first]
var second = SecondViewController(nibName: nil, bundle: nil)
var nav2 = UINavigationController()
nav2.viewControllers = [second]
var tabs = UITabBarController()
tabs.viewControllers = [nav1, nav2]
self.window!.rootViewController = tabs;
self.window?.makeKeyAndVisible();
return true
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment