title: Text value of Text Field is Empty Swift
body: <p>I got a textfield where you need to enter your name in.
  But when i try to store the value of the textfield in my array, the value of the text field is always empty. </p>
  
  <p>I declared these <code>IBOutlets</code></p>
  
  <pre><code>@IBOutlet var input: UITextField
  @IBOutlet var error: UILabel
  </code></pre>
  
  <p>error is a label where I store a error message.</p>
  
  <p>My <code>IBAction</code> when the button is clicked:</p>
  
  <pre><code>    @IBAction func btnSave() {
          println("Clicked on Save")
          println("\(input.text)")
          if input.text.isEmpty {
             error.text = "Enter a name"
          } else {
             clNaam.addName(input.text)
             self.view.endEditing(true)
             error.text = ""
          }
      }
  </code></pre>
  
  <p>Everything is hooked up correctly. 
  This is my class for adding a name.</p>
  
  <pre><code>var clNaam: addNaam = addNaam()
  
  struct naam {
     var naam = "Nil"
  }
  
  class addNaam: NSObject {
      var aNaam = naam[]()
  
      func addName(name: String) {
          aNaam.append(naam(naam: name))
      }
   }
  </code></pre>
  
  <p>There probably is a problem in my code but I can't find it, I searched on the web and the  apple developer site but I can't find what I'm doing wrong.</p>