title: Setting UITextField heightAnchor to 0 does not work on iOS 15
body: <p>I have an iOS application where i have a textfield and a button and on tap of button i have to hide the textfield.</p>
  <p>I am setting heightAnchor to 0 on tap of button. Everything is working fine on iOS 14(14.5) but does not work(does not hide the text field) on iOS 15. Also, I have tried setting up the isHidden property on UITextField but it does not work.</p>
  <p>Can you please help tell if something changed or i am doing something wrong. Thank you.</p>
  <p>Code reference:</p>
  <pre><code>import UIKit
  
  class ViewController: UIViewController {
  
    private lazy var mytextFeild: UITextField = {
      let textField = UITextField()
      textField.translatesAutoresizingMaskIntoConstraints = false
      textField.text = &quot;Hello world&quot;
      textField.backgroundColor = .green
      return textField
    }()
     
    private lazy var testView: UIView = {
      let view = UIView()
      view.translatesAutoresizingMaskIntoConstraints = false
      view.backgroundColor = .systemPink
      return view
    }()
     
    private lazy var button: UIButton = {
      let view = UIButton()
      view.backgroundColor = .blue
      view.setTitle(&quot;hide it&quot;, for: .normal)
      view.translatesAutoresizingMaskIntoConstraints = false
       
      view.addTarget(self, action: #selector(buttonTapped), for: .touchUpInside)
      return view
    }()
     
    var heightConstraint: NSLayoutConstraint?
     
    @objc func buttonTapped() {
      heightConstraint?.isActive = false
      heightConstraint = mytextFeild.heightAnchor.constraint(equalToConstant: 0)
      heightConstraint?.isActive = true
    }
  
    override func viewDidLoad() {
      super.viewDidLoad()
      view.addSubview(mytextFeild)
      view.addSubview(testView)
      view.addSubview(button)
       
      mytextFeild.leadingAnchor.constraint(equalTo: view.leadingAnchor, constant: 32).isActive = true
      mytextFeild.trailingAnchor.constraint(equalTo: view.trailingAnchor, constant: -32.0).isActive = true
      mytextFeild.topAnchor.constraint(equalTo: view.topAnchor, constant: 64).isActive = true
      heightConstraint = mytextFeild.heightAnchor.constraint(equalToConstant: 32.0)
      heightConstraint?.isActive = true
      button.leadingAnchor.constraint(equalTo: view.leadingAnchor, constant: 32.0).isActive = true
      button.trailingAnchor.constraint(equalTo: view.trailingAnchor, constant: -32.0).isActive = true
      button.heightAnchor.constraint(equalToConstant: 32.0).isActive = true
      button.bottomAnchor.constraint(equalTo: view.bottomAnchor, constant: -64.0).isActive = true
       
      testView.leadingAnchor.constraint(equalTo: view.leadingAnchor).isActive = true
      testView.trailingAnchor.constraint(equalTo: view.trailingAnchor).isActive = true
      testView.topAnchor.constraint(equalTo: mytextFeild.bottomAnchor).isActive = true
      testView.bottomAnchor.constraint(equalTo: button.topAnchor).isActive = true
    }
  }
  </code></pre>
  <p><a href="https://i.stack.imgur.com/xMrpb.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/xMrpb.png" alt="enter image description here" /></a></p>