title: Swift programmatically set segues
body: <p>I have a piece of parse code that checks to see if a user is logged in:</p>
  
  <pre><code>PFUser.logInWithUsernameInBackground("myname", password:"mypass") {
    (user: PFUser!, error: NSError!) -&gt; Void in
    if user != nil {
      // Do stuff after successful login.
    } else {
      // The login failed. Check error to see why.
    }
  }
  </code></pre>
  
  <p>After the successful login I want to send the user to a new segue. I can't do this in the storyboard because I only want the segue to occur if the conditions are met. Is there anyway to create a segue programmatically?</p>