title: How to check if a text field is empty or not in swift
body: <p>I am working on the code below to check the <code>textField1</code> and <code>textField2</code> text fields whether there is any input in them or not. </p>
  
  <p>The <code>IF</code> statement is not doing anything when I press the button.</p>
  
  <pre><code> @IBOutlet var textField1 : UITextField = UITextField()
   @IBOutlet var textField2 : UITextField = UITextField()
   @IBAction func Button(sender : AnyObject) 
    {
  
      if textField1 == "" || textField2 == "" 
        {
  
    //then do something
  
        }  
    }
  </code></pre>