Skip to content

Instantly share code, notes, and snippets.

@khle
Forked from tfrank64/AppDelegate.swift
Created August 30, 2016 05:08
Show Gist options
  • Save khle/7fe9abdac088b257a2c5e848d897e17b to your computer and use it in GitHub Desktop.
Save khle/7fe9abdac088b257a2c5e848d897e17b 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