title: perform segue in viewDidLoad() without navigation controller in Swift
body: <p>I have three views (view 1 checks a server connection, view 2 shows the main content, view3 shows the support page) and I created them in the storyboard without coding. On starting my iOS app the view 1 shows a spinner while checking the server connection. If the connection check is passed then I want to go to view 2 and if it's failed then I want to go to view 3. The view 1 is only for the connection check and I don't want to go back to this view. So, I think I don't need a navigation controller, or?</p>
  
  <p>In storyboard I connected all view with seques. In my view controller of view 1 I do this:</p>
  
  <pre><code>override func viewDidLoad() {
      super.viewDidLoad()
  
      let result:Bool = server.isServerAvailable(myURL)
  
      if (result == true) {
          performSegueWithIdentifier("ConnectionCheckToMain", sender: self)
      }
      else {
          performSegueWithIdentifier("ConnectionCheckToSupport", sender: self)
      }
  }
  </code></pre>
  
  <p>But this segue in the <code>viewDidLoad()</code> function doesn't work, but I don't know why. I've added a button on view to check it. I've implemented the same code like in <code>viewDidLoad()</code> and it works fine. On clicking the button the next view loads.</p>
  
  <p>Is there any idea why the code doesn't work?</p>