title: How to restrict UIButton height using NSLayoutConstraint
body: <p>I have <code>UItoolbar</code> in which added two items 1. <code>UITextView</code> and 2. <code>UIButton</code>.
  The Property of <code>UITextview</code> is to autogrowing based on entered text.
  While growing of height of <code>UITextview</code> i want to restrict <code>UIButton</code> height, i.e <code>UIButton</code> height should not be increase. </p>
  
  <pre><code>[_toolbar setItems:[NSArray arrayWithObjects:barButtonItemCommentText,barButtonItemSubmit,nil]];
  submitBtn.translatesAutoresizingMaskIntoConstraints = NO;
  textView.translatesAutoresizingMaskIntoConstraints = NO;
  _toolbar.translatesAutoresizingMaskIntoConstraints = NO;
  
  [_toolbar addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|-8-[textView]-79-|" options:0 metrics:nil views:NSDictionaryOfVariableBindings(textView)]];
  
   [_toolbar addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|-8-[textView]-8-|" options:0 metrics:nil views:NSDictionaryOfVariableBindings(textView)]];
  
  [_toolbar addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|-[submitBtn]-8-|" options:0 metrics:nil views:NSDictionaryOfVariableBindings(submitBtn)]];
  
  
  [_toolbar addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|-8-[submitBtn]-8-|" options:NSLayoutFormatAlignAllBaseline metrics:nil views:NSDictionaryOfVariableBindings(submitBtn)]];
  
  [_toolbar addConstraint:[NSLayoutConstraint constraintWithItem:submitBtn
                                                   attribute:NSLayoutAttributeWidth
                                                   relatedBy:NSLayoutRelationEqual
                                                      toItem:nil
                                                   attribute:NSLayoutAttributeNotAnAttribute 
                                                  multiplier:1.0 
                                                    constant:60]];
  [textView setContentCompressionResistancePriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal];
  [textView setContentCompressionResistancePriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisVertical];
  
  [_toolbar setContentCompressionResistancePriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisVertical];
  
  
  [_toolbar addConstraint:[NSLayoutConstraint constraintWithItem:_toolbar attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationLessThanOrEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0f constant:MaxToolbarHeight]];
  </code></pre>
  
  <p>For reference , see the attached screen-shot:</p>
  
  <p><a href="https://i.stack.imgur.com/eLJEb.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/eLJEb.png" alt="Toolbar with autoresizeing UITextView and UIButton"></a></p>