title: Checking whether a NSLayoutConstraint has been applied or not
body: <p>I have a UITextView subclass that has a height constraint with priority 500. All other constraints in the view it's inserted in have 1000 priority, therefore when constraints can't be satisfied this one is the one that gets dropped.</p>
  
  <p>I want to be able to verify if it was dropped or not in order to enable scrolling in that case.</p>
  
  <p>I tried to verify it this way:</p>
  
  <pre><code>- (void)updateConstraints
  {
  CGSize size = [self sizeThatFits:CGSizeMake(self.bounds.size.width, FLT_MAX)];
  
  if (!heightConstraint) {
      heightConstraint = [NSLayoutConstraint constraintWithItem:self attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:0 multiplier:1.0f constant:size.height];
      heightConstraint.priority=500;
      [self addConstraint:heightConstraint];
  }
  else heightConstraint.constant=size.height;
  [super updateConstraints];
  
  if (self.bounds.size.height!=heightConstraint.constant) {
      self.scrollEnabled=YES;
  }
  
  
  
  
  
  }
  </code></pre>
  
  <p>Thank you.</p>