Created
June 8, 2014 17:32
-
-
Save tfrank64/4cf9f0da800a427e368b to your computer and use it in GitHub Desktop.
Swift UITabBar Programmatically
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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