title: Opening view controller from app delegate using swift
body: <p>I am trying to create a push notification which determines which view to open according to information obtained from the push.</p>
  
  <p>I have managed to get the information from the push, but I am now struggling to get the view to open</p>
  
  <p>Looking at other stack overflow questions I have the following currently:</p>
  
  <p>App Delegate Did finish loading:</p>
  
  <pre><code>     //Extract the notification data
      if let notificationPayload = launchOptions?[UIApplicationLaunchOptionsRemoteNotificationKey] as? NSDictionary {
          // Get which page to open
          let viewload = notificationPayload["view"] as? NSString
          let storyBoard : UIStoryboard = UIStoryboard(name: "Main", bundle:nil)
          //Load correct view
          if viewload == "circles" {
  
              var viewController = self.window?.rootViewController?.storyboard?.instantiateViewControllerWithIdentifier("Circles") as! UIViewController
              self.window?.rootViewController = viewController
  
                          }
      }
  </code></pre>
  
  <p>Currently this is failing on the var ViewController = self... line.</p>