Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
import UIKit
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
private var myTabBarController: UITabBarController!
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
window = UIWindow(frame: UIScreen.mainScreen().bounds)
let myFirstTab: UIViewController = FirstViewController()
let mySecondTab: UIViewController = SecondViewController()
let myTabs = NSArray(objects: myFirstTab, mySecondTab)
myTabBarController = UITabBarController()
myTabBarController?.setViewControllers(myTabs as?[UIViewController], animated: false)
self.window!.rootViewController = myTabBarController
return true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment