title: How can I disable button until both textFields have at least one character in them?
body: <p>I am trying to disable a login button until both email and password textFields have at least one character in both of them. I tried looking up different answers but the code seems to be outdated on the answers I could fine. I also do not know how to observe the TextFields values to see if there is change. Can someone please assist me or point me in the right direction? </p>
  
  <p>This is the count I currently have.</p>
  
  <pre><code>func viewDidLoad() {
  super.viewDidLoad()
  // Setting text field delegates
  
  emailTextField.delegate = self
  
  passwordTextField.delegate = self
  
  //checking if both textFields are filled in to enable Login Button
  
  if (emailTextField.text?.count)! &gt; 0  &amp;&amp; (passwordTextField.text?.count)! &gt; 0    {
  
  loginButton.isEnabled = true
  loginButton.alpha = 0.55
  
  } else {
      loginButton.isEnabled = false
      loginButton.alpha = 0.32
  
  }
  
  
  
  }
  </code></pre>