I have a label and button in a superView like this.
|--------------[Label]-----[button]-|
I\'d like the
You just set the priority property of the constraint, like so:
NSLayoutConstraint *centeringConstraint =
[NSLayoutConstraint constraintWithItem:_label
attribute:NSLayoutAttributeCenterX
relatedBy:NSLayoutRelationEqual
toItem:self.contentView
attribute:NSLayoutAttributeCenterX
multiplier:1.0
constant:0.0];
centeringConstraint.priority = 800; // <-- this line
[self addConstraint:centeringConstraint];