title: Check if Swift text field contains non-whitespace
body: <p>This is an extension, not a duplicate, of <a href="https://stackoverflow.com/questions/24102641/how-to-check-if-a-text-field-is-empty-or-not-in-swift">How to check if a text field is empty or not in swift</a></p>
  
  <p>The given answer, </p>
  
  <pre><code>@IBAction func Button(sender: AnyObject) {
      if textField1.text != ""  {
          // textfield 1 
      }
  }
  </code></pre>
  
  <p>does not work for me, i.e., the if-loop is triggered even when nothing is entered in the text field.  (I have modified it from the original because I'm looking to trigger the code only when the field contains text).</p>
  
  <p>The second answer</p>
  
  <pre><code>@IBAction func Button(sender: AnyObject) {
      if !textField1.text.isEmpty{
  
      }
  }
  </code></pre>
  
  <p>comes much closer, but it accepts strings like <code>"     "</code> as not empty.  I could build something myself, but is there a function that will check if a string contains something other than whitespace?</p>