title: Swift Changing View with performSegueWithIdentifier / programmatically
body: <p>So I am trying to programmatically change views when some condition is triggered.</p>
  
  <p>I have created a simplistic project, whereby I want to change to View 2 from View 1, once View 1 has loaded. In reality, there is some logical operation that checks if some variable is true, then it invokes the performSegueWithIdentifier function, however to keep this as simple as possible I have removed that code.</p>
  
  <p>The steps I have performed are, firstly to create two views:
  <img src="https://i.stack.imgur.com/l3DLT.png" alt="Showing Two Views"></p>
  
  <p>I then click View 1, and inspect its properties and then created a manually triggered segue to View 2
  <img src="https://i.stack.imgur.com/M35Oq.png" alt="Connecting Manual Segue"></p>
  
  <p>I selected the 'Show' option, so now my Views are connected by a segue
  <img src="https://i.stack.imgur.com/uGvVH.png" alt="Connected Manual Segue">
  Then under attribute inspector, I give the storyboard segue and identifier of "GoToView2". 
  <img src="https://i.stack.imgur.com/SdYB1.png" alt="Naming Segue">
  From there I go to the ViewController.swift file, and in the viewDidLoad function. I insert performSegueWithIdentifier code:</p>
  
  <pre><code>self.performSegueWithIdentifier("GoToView2", sender: self)
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/WhOMj.png" alt="Adding PerformSegueWithIdentifier Code"></p>
  
  <p>However, when I then run the code. View 2 does not load, and only View 1 appears in the simulator.</p>
  
  <p>Any help and explanation would be greatly appreciated.</p>