After a while I found the answer:
The first time you need to create rootViewController and detailViewController. For example, rootViewController will inherit from UITableViewController, and detailViewController will inherit from UIViewController. Next time you will need to do this:
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: NSDictionary?) -> Bool { self.window = UIWindow(frame: UIScreen.mainScreen().bounds) self.window!.backgroundColor = UIColor.whiteColor() var splitViewController = UISplitViewController() var rootViewController = RootViewController() var detailViewController = DetailViewController() splitViewController.viewControllers = [rootViewController,detailViewController] self.window!.rootViewController = splitViewController self.window!.makeKeyAndVisible() return true }
source share