title: How To Show ViewController from CDVPlugin in Cordova?
body: <p>I have been struggling with this for a few days and cannot get it to work, nor find anyone else that seems to have figured this out. Hoping someone can help.</p>
  
  <p>I have a simple ViewController with 2 views in a Storyboard in Swift that I am trying to open through a Cordova plugin (Android version works). I have gotten it to the point where it does not error and I see every line of code being hit, but I am still not seeing the ViewController show. The standalone version of the application works fine.</p>
  
  <p>Here is the code for the plugin call:</p>
  
  <pre><code>import Foundation
  
  @objc(SomePlugin) class SomePlugin : CDVPlugin {
      func show(command: CDVInvokedUrlCommand) {
          // step 1. take a storyboard variable
          var storyBoard:UIStoryboard? = nil
          storyBoard = UIStoryboard(name: "Main", bundle: nil)
  
          // step 2. un-box storyboard to sb variable
          if let sb = storyBoard {
  
              // step 3. create new window
              var window = UIWindow(frame: UIScreen.mainScreen().bounds)
  
              // step 4. start view controller
              window.rootViewController = sb.instantiateInitialViewController() as ViewController
  
              // step 5. make key window &amp; visible
              window.makeKeyAndVisible()
          }
      }
  }
  </code></pre>
  
  <p>If anything else can be of help, please let me know. Thanks in advance!</p>