- (void)addConstraintBindingToView:(UIView *)view onAttribute:(NSLayoutAttribute)attribute;
Adds the a constraint to the receiver binding it to the given view on the given attribute.
Parameters
-
view
: The view to which to bind the receiver. -
attribute
: The attribute on which to bind the views
Discussion
This method adds the constraint to the super-most view, of the receiver and view
. The constraint's relationship is Equal, its multiplier is 1, and its constant is 0.
@property (nonatomic, readonly) NSLayoutConstraint *heightConstraint;
The primary constraint responsible for the view's height.
Discussion
The constraint might be applied to the view's superview.
@property (nonatomic, readonly) NSLayoutConstraint *horizontalOriginConstraint;
The primary constraint responsible for the view's horizontal origin.
Discussion
The constraint might be applied to the view's superview.
@property (nonatomic, readonly) NSLayoutConstraint *verticalOriginConstraint;
The primary constraint responsible for the view's vertical origin.
Discussion
The constraint might be applied to the view's superview.
@property (nonatomic, readonly) NSLayoutConstraint *widthConstraint;
The primary constraint responsible for the view's width.
Discussion
The constraint might be applied to the view's superview.
@property (nonatomic, readonly) NSLayoutConstraint *heightConstraint;
The primary constraint responsible for the view's height.
Discussion
The constraint might be applied to the view's superview.
- (void)addConstraint:(NSLayoutConstraint *)constraint withIdentifier:(NSString *)identifier;
Adds the given constraint to the receiver with the given identifier.
Parameters
-
constraint
: The constraint to add. -
identifier
: The identifier for the constraint.
- (NSLayoutConstraint *)constraintWithIdentifier:(NSString *)identifier;
Returns the constraint with the given identifier.
Parameters
identifier
: The constraint's identifier.
Returns
The constraint with the given identifier.
@property (nonatomic) NSString *identifier;
A string identifying the constraint.
You can use Interface Builder's User-Defined Attributes to set the identifier of a constraint.