title: Button to instanciate ViewController is not working after hiding it
body: <p>I have this very weird problem that I just found out...</p>
  <p>I have this <code>button</code> which is triggering this <code>function</code>:</p>
  <pre><code>@objc func vergessenTapped() {
      let forgotPasswordVC = self.storyboard?.instantiateViewController(withIdentifier: &quot;ForgotPasswordVC&quot;) as! ForgotPasswordVC
      forgotPasswordVC.email = self.emailTextField.text!
      self.present(forgotPasswordVC, animated: true, completion: nil)
  }
  </code></pre>
  <p>I also have these function which <code>hide</code>/<code>show</code> the <code>button</code> above:</p>
  <pre><code>    // delegate Methode für eye-Button
  func textFieldShouldBeginEditing(_ textField: UITextField) -&gt; Bool {
      switch textField {
      case passwordTextField:
          if passwordTextField.text != &quot;&quot; {
              eyeButton.isHidden = false
              vergessenButton.isHidden = true
          } else {
              eyeButton.isHidden = true
          }
  
          break
      default:
          break
      }
      return true
  }
  // delegate Methode für eye-Button
  func textFieldShouldEndEditing(_ textField: UITextField) -&gt; Bool {
      
      if textField == passwordTextField {
          self.eyeButton.isHidden = true
          self.vergessenButton.isHidden = false
      }
      return true
  }
  
  @objc func textFieldDidChange(_ textField: UITextField) {
      if textField.text == &quot;&quot; {
          self.eyeButton.isHidden = true
          self.vergessenButton.isHidden = false
      }else {
          self.vergessenButton.isHidden = true
          self.eyeButton.isHidden = false
      }
  }
  </code></pre>
  <p>Now the <strong>Problem:</strong></p>
  <p>When I press the <code>button</code> the first time before any of the <code>delegate-function</code> above are hiding it, the <code>ViewController</code> it <code>presents</code> works just fine.</p>
  <p>However: As soon as the button is hidden for the first time, and the user clicks it after it is visible again the <code>forgotpasswordViewController</code> behaves really really weird, e.g:</p>
  <p><strong>1.</strong> when calling <code>self.dismiss</code> , the `ViewController is actually not dismissed, but is popping the one <em>below</em>  it.</p>
  <pre><code>@objc func backButtonTapped(){
      self.dismiss(animated: true, completion: nil)
  }
  </code></pre>
  <p><strong>2.</strong> The <code>button</code> in the <code>forgotpasswordViewController</code>  (only one button there)  is not doing anything.</p>
  <p>Here is a <a href="https://gofile.io/d/s3h2CK" rel="nofollow noreferrer">Screenvideo</a> for a better understanding. 22 seconds into the video I start typing (somehow not visible on the screenvideo but you can see that the &quot;vergessen&quot; but disappears and appears again. After appearing again I click it and as you can see, neither the <code>backButton</code> nor the <code>confirmButton</code> work like they did before...</p>
  <p>Is this some kind of bug??? I can't explain it .. so if anyone helps me out here I would really appreciated!</p>
  <p><em><strong>Demo-Project:</strong></em></p>
  <p><a href="https://gofile.io/d/NsuFNw" rel="nofollow noreferrer">Demo-Project</a></p>