title: UIView's height constraints break child view's height constraint
body: <p>I have a really simple setup that I can't get to do what I want.</p>
  
  <p>I'm trying to add an <code>inputAccessoryView</code>.</p>
  
  <p>For the <code>inputAccessoryView</code> I have a <code>UIView</code> (<strong>ViewA</strong>) with a subview (<strong>ViewB</strong>). <strong>ViewB</strong> is fixed to all edges of <strong>ViewA</strong>. <strong>ViewB</strong> has a fixed height, which needs to be the height of both <strong>ViewA</strong> and <strong>ViewB</strong>.</p>
  
  <p><strong>ViewA</strong>'s isn't set by me, but is <code>0</code> which breaks the height of <strong>ViewB</strong> (set to 42).</p>
  
  <p><strong>ViewA</strong> is added as a subview on a <code>UIViewController</code>'s view and fixed to the bottom and both the leading and trailing edges (so width of <strong>ViewA</strong> and <strong>ViewB</strong> should be that of the UIViewController's view, which it is).</p>
  
  <p>Here's the code I have:</p>
  
  <pre><code>override init(frame: CGRect) {
      super.init(frame: frame)
  
      let viewB = UIView()
      addSubview(viewB)
  
      viewB.translatesAutoresizingMaskIntoConstraints = false
      viewB.topAnchor.constraint(equalTo: topAnchor).isActive = true
      viewB.leadingAnchor.constraint(equalTo: leadingAnchor).isActive = true
      viewB.bottomAnchor.constraint(equalTo: bottomAnchor).isActive = true
      viewB.trailingAnchor.constraint(equalTo: trailingAnchor).isActive = true
      viewB.heightAnchor.constraint(equalToConstant: 42).isActive = true
  }
  </code></pre>
  
  <p>Which results in the following error:</p>
  
  <pre><code>2017-12-02 15:44:59.150228-0800 Ping[37511:5808904] [LayoutConstraints] Unable to simultaneously satisfy constraints.
      Probably at least one of the constraints in the following list is one you don't want. 
      Try this: 
          (1) look at each constraint and try to figure out which you don't expect; 
          (2) find the code that added the unwanted constraint or constraints and fix it. 
      (Note: If you're seeing NSAutoresizingMaskLayoutConstraints that you don't understand, refer to the documentation for the UIView property translatesAutoresizingMaskIntoConstraints) 
  (
      "&lt;NSAutoresizingMaskLayoutConstraint:0x608000283b60 h=--&amp; v=--&amp; MyApp.ViewA:0x7fe606511360.height == 0   (active)&gt;",
      "&lt;NSLayoutConstraint:0x608000282030 UIView:0x7fe606511550.height == 42   (active)&gt;",
      "&lt;NSLayoutConstraint:0x608000281d60 V:|-(0)-[UIView:0x7fe606511550]   (active, names: '|':MyApp.ViewA:0x7fe606511360 )&gt;",
      "&lt;NSLayoutConstraint:0x608000281ef0 UIView:0x7fe606511550.bottom == MyApp.ViewA:0x7fe606511360.bottom   (active)&gt;"
  )
  
  Will attempt to recover by breaking constraint 
  &lt;NSLayoutConstraint:0x608000282030 UIView:0x7fe606511550.height == 42   (active)&gt;
  
  Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
  The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in &lt;UIKit/UIView.h&gt; may also be helpful.
  </code></pre>
  
  <p><strong>ViewA</strong> has a pretty simple setup:</p>
  
  <pre><code>extension MessageViewController {
  
      open override var canBecomeFirstResponder: Bool {
          return true
      }
  
      open override var inputAccessoryView: UIView? {
          return messageInputView
      }
  
  }
  </code></pre>
  
  <p>Why does <strong>ViewA</strong> height that I never set break the constraint that I setup?</p>