title: heightAnchor.constraint does not work (Apple FoodTracker Tutorial using Swift)
body: <p>I've been doing a iOS tutorial from Apple; Start Developing iOS Apps.
  <a href="https://developer.apple.com/library/content/referencelibrary/GettingStarted/DevelopiOSAppsSwift/ImplementingACustomControl.html#//apple_ref/doc/uid/TP40015214-CH19-SW1" rel="noreferrer">https://developer.apple.com/library/content/referencelibrary/GettingStarted/DevelopiOSAppsSwift/ImplementingACustomControl.html#//apple_ref/doc/uid/TP40015214-CH19-SW1</a></p>
  
  <p>In the tutorial, I added a button which has the size constraint of 44.0x44.0 on a Horizontal stack view.
  However, the simulator shows a larger button.</p>
  
  <p><a href="https://i.stack.imgur.com/LnNHW.png" rel="noreferrer">looks the size constraints do not work.</a></p>
  
  <p>My code is below. Can you give advices to fix?</p>
  
  <pre><code>class RatingControl: UIStackView {
      //MARK: Initialization
      override init(frame: CGRect) {
          super.init(frame: frame)
          setupButtons()
      }
      required init(coder: NSCoder) {
          super.init(coder: coder)
          setupButtons()
      }
  
      //MARK: Private Methods
      private func setupButtons() {
          let button = UIButton()
          button.backgroundColor = UIColor.red
          // Add constraints
          button.translatesAutoresizingMaskIntoConstraints = false
          button.heightAnchor.constraint(equalToConstant: 44.0).isActive = true
          button.widthAnchor.constraint(equalToConstant: 44.0).isActive = true
          addArrangedSubview(button)
      }
  }
  </code></pre>
  
  <p>The problem was fixed by changing the property of the StackView.</p>