title: How to programmatically add an InputAccessoryView with Autolayout?
body: <p>I am trying to add a <code>UIView</code> with "Done" button as an input accessory view to the text field.</p>
  
  <pre><code>        let view = UIView()
          let doneButton = UIButton(type: .Custom)
          doneButton.setTitle("Done", forState: .Normal)
          doneButton.translatesAutoresizingMaskIntoConstraints = false
          view.addSubview(doneButton)
          view.addConstraints(NSLayoutConstraint.constraintsWithVisualFormat("H:[button]-|", options: NSLayoutFormatOptions.DirectionLeadingToTrailing, metrics: nil, views: ["button":doneButton]))
          view.addConstraints(NSLayoutConstraint.constraintsWithVisualFormat("V:|[button]|", options: NSLayoutFormatOptions.DirectionLeadingToTrailing, metrics: nil, views: ["button":doneButton]))
          view.addConstraint(NSLayoutConstraint(item: view, attribute: NSLayoutAttribute.Height, relatedBy: NSLayoutRelation.Equal, toItem: doneButton, attribute: NSLayoutAttribute.Height, multiplier: 1, constant: 0)) // Even this does not work
          self.emailTextField.inputAccessoryView = view
  </code></pre>
  
  <p>But however I cannot see the views height being set nor the buttons in the View Hierarchy debugger/inspector in Xcode.</p>
  
  <p>But if I add a view by setting its frame I can see the view being added.
  Also I tried setting height constraint forcibly to a constant 21 and it broke some other constraints which I had not added <strong>_UIKBAutolayoutHeightConstraint</strong></p>
  
  <pre><code>"&lt;NSLayoutConstraint:0x7fa3c962be50 UIView:0x7fa3c963bf60.height == UIButton:0x7fa3c963c0d0.height + 21&gt;",
      "&lt;NSLayoutConstraint:0x7fa3c95e0a90 '_UIKBAutolayoutHeightConstraint' V:[UIView:0x7fa3c963bf60(0)]&gt;"
  </code></pre>
  
  <p>Any one faced this issue before ?</p>