Tuesday, 8 December 2015

SWIFT : Custom ViewController as InitialViewController

Go to AppDelegate.swift


var window: UIWindow?


func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
         self.window = UIWindow(frame: UIScreen.mainScreen().bounds)
        let mainStoryboard: UIStoryboard = UIStoryboard(name: "Main", bundle: nil)
        let wViewController =        mainStoryboard.instantiateViewControllerWithIdentifier("ViewController") as? ViewController
       self.window?.rootViewController = wViewController
       self.window?.makeKeyAndVisible()
       return true
}

No comments:

Setting Up Multiple App Targets in Xcode from a Single Codebase

 To create two different apps (like "Light" and "Regular") from the same codebase in Xcode, you can follow these steps b...