title: Passing variable back to parent in Swift
body: <p>I am re-writing a tutorial converting the code from Objective-C to swift. The app moves from VC one where there is 3 sliders (Red, Green and Blue) that set the background colour, a label of the colour name and a button that links to the second VC. In the second VC the colour from the first VC is used as the background and the user has a chance to name the colour. </p>
  
  <p>When the user enters the colour name it should return the new colour name to the orginal VC and the label that shows the colour name should show the text entered.</p>
  
  <p>The following is the code that is causing issue:</p>
  
  <pre><code>func textFieldShouldReturn(nameEntry: UITextField) -&gt; Bool
  {
      ViewController().colourLabel.text = nameEntry.text
      nameEntry.resignFirstResponder()
      dismissViewControllerAnimated(true, completion: nil)
      return true
  }
  </code></pre>
  
  <p>The error "<strong>fatal error</strong>: unexpectedly found nil while unwrapping an Optional value" is generated. However debugging nameEntry.text has a string in it.</p>
  
  <p>I'm a little stumped. I could try and do a prepare for unwind segue but it is meant to be a tutorial app.</p>
  
  <p>Cheers</p>