title: How to prevent superview from growing when adding proportional width constraint (OSX AutoLayout)
body: <p>I have a test view, which has a label (NSTextField) inside, and I programmatically add a proportional width constraint so that my test view takes 1/3 width of its superview (the view of main view controller). When I set the short title, for example, "short text" for the label, my test view is shown correctly (it takes 1/3 width of the superview). However when I try to set the long title, for example, "long long long long long long text" for the label, the superview is grown and the label shows full text. My expectation is that the superview size should not be changed, my test view should take 1/3 width and my label should be truncated to show "..." at tail.</p>
  
  <p>The test view is shown correctly with short text:
  <img src="https://i.stack.imgur.com/aYCwP.png" alt="superview is not grown"></p>
  
  <p>The test view is shown incorrectly with long text:
  <img src="https://i.stack.imgur.com/EsZNy.png" alt="superview is grown"></p>
  
  <p>My codes to programmatically add constraints for the test view:</p>
  
  <pre><code>TestView *testView = [[TestView alloc] initWithFrame:NSMakeRect(5, 10, 120, 30)];
  
  NSString *title = @"long long long long long long text";
  //NSString *title = @"short text";
  
  [testView setTitle:title];
  
  [self.view addSubview:testView];
  
  float multiplierWidth = (float) 1/3;
  float multiplierLeading = (float) 1/3;
  
  NSLayoutConstraint *widthConstraint = [NSLayoutConstraint constraintWithItem:testView attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:testView.superview attribute:NSLayoutAttributeWidth multiplier:multiplierWidth constant:0.0];
  
  NSLayoutConstraint *leadingConstraint = [NSLayoutConstraint constraintWithItem:testView attribute:NSLayoutAttributeLeading relatedBy:NSLayoutRelationEqual toItem:testView.superview attribute:multiplierLeading==0?NSLayoutAttributeLeading:NSLayoutAttributeTrailing multiplier:multiplierLeading==0?1.0:multiplierLeading constant:0.0];
  
  NSLayoutConstraint *topConstraint = [NSLayoutConstraint constraintWithItem:testView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:testView.superview attribute:NSLayoutAttributeTop multiplier:1.0 constant:testView.frame.origin.y];
  
  NSLayoutConstraint *heightConstraint = [NSLayoutConstraint constraintWithItem:testView attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:testView.frame.size.height];
  
  [testView setTranslatesAutoresizingMaskIntoConstraints:NO];
  
  [testView addConstraint:heightConstraint];
  [testView.superview addConstraint:topConstraint];
  
  [testView.superview addConstraint:leadingConstraint];
  [testView.superview addConstraint:widthConstraint];
  </code></pre>
  
  <p>Here is the sample project: <a href="https://drive.google.com/open?id=1ZtGr646ElIGsWdnvXEf1skWvTYw6yI-m" rel="nofollow noreferrer">sample project</a></p>