Skip to content

Instantly share code, notes, and snippets.

@chuck0523
Created July 14, 2016 03:36
Show Gist options
  • Save chuck0523/13b00d0ae8b71439966efd2856014f3c to your computer and use it in GitHub Desktop.
Save chuck0523/13b00d0ae8b71439966efd2856014f3c to your computer and use it in GitHub Desktop.
import UIKit
@UIApplicationMain
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
self.window!.makeKeyAndVisible()
return true
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment