title: Presenting viewController (within Navigation hierarchy) via appDelegate openURL function
body: <p>My initial view controller is a login page, which checks if the current user is logged in. If so, a segue is performed to the next view, which is to a tab bar controller, whose default selected tab is a table view (that has been embedded in a navigation controller).</p>
  
  <p>Within this table view is a list of event objects. When a user selects an event object, the event details display in a new view, and the navigation bar appears above, allowing the user to return back to their list of events. This is all working properly.</p>
  
  <p>However, the application has a URL scheme that allows it to be launched via a URL. Within my app Delegate, I am able to capture the URL scheme and query I need. </p>
  
  <p>My problem is when I try to present the necessary view controller. I'm actually able to present the view controller (which is an event details view controller), but this view controller is not within the navigation hierarchy, which I need. Can't figure out how to do this (again the below code is within the openURL function of appDelegate, which is called via my custom URL Scheme):</p>
  
  <pre><code>        let storyboard = UIStoryboard(name: "Main", bundle: nil)
  
          //the viewController to present
          let viewController = storyboard.instantiateViewControllerWithIdentifier("SingleEventAfterCreationViewController") as! SingleEventAfterCreationViewController
  
          let eventListNavController = storyboard.instantiateViewControllerWithIdentifier("EventsListNavigationController") as! UINavigationController
  
  //set a bunch of properties on my viewController
  
  //below is where I'm unsure. The correct view controller is presented, but the navigation bar above, and tab bar below is lost. Subsequently, when I click on a "user" of the event, the program crashes, I'm guessing because there is no navigation hierarchy. 
  
  self.window?.rootViewController = eventListNavController
  
                  self.window?.rootViewController?.presentViewController(viewController, animated: true, completion: nil)
  </code></pre>
  
  <p>The crash text:</p>
  
  <blockquote>
    <p>Terminating app due to uncaught exception 'NSGenericException', reason: 'Could not find a navigation controller for segue 'showProfileSegue'. Push segues can only be used when the source controller is managed by an instance of UINavigationController.'</p>
  </blockquote>
  
  <p>I have attached an image of my storyboard to help illustrate my problem, as well as an image of what happens now when opening the app via a URL, and what action from that view crashes it. I've also attached an image of what the presented view controller should look like.</p>
  
  <p>storyboard full screen: <a href="https://s3.postimg.org/oywzb595f/storyboard_help.png" rel="nofollow noreferrer">https://s3.postimg.org/oywzb595f/storyboard_help.png</a></p>
  
  <p>my storyboard:
  <img src="https://s3.postimg.org/oywzb595f/storyboard_help.png" alt="storyboard"></p>
  
  <p>the problem:
  <img src="https://s10.postimg.org/hgcir5c49/Screen_Shot_2015_09_07_at_7_35_54_PM.png" alt="where i&#39;m at now"></p>
  
  <p>what it should look like:
  <img src="https://s1.postimg.org/4689mqkmn/example.png" alt="what it should look like"></p>