title: How to create UISplitViewController programmatically in Swift
body: <p>Is there anyone who can help me to explain how to make UISpliterController programmatically in Swift. In my application I want to apply the supporting feature of iphone device and ipad. If the app is running on iphone then use single controler but if the application is running on ipad then use UISpliterController with existing ViewController.</p>
  
  <p>I have tried it but it always produce blackscreen
  Here is my code.</p>
  
  <pre><code>if UIDevice.current.userInterfaceIdiom == .pad {
  
      let spliterVC = UISplitViewController()
      let homeNavControler = mainStoryboard.instantiateViewController(withIdentifier: "homeViewController") as! HomeViewController
  
      let secondVC = mainStoryboard.instantiateViewController(withIdentifier: "secondViewController") as! SecondViewController
      spliterVC.viewControllers = [homeNavControler,secondVC]
      appdelegate.window?.rootViewController = spliterVC
  }
  </code></pre>