constraint(equalToConstant:)
Returns a constraint that defines a constant size for the anchor’s size attribute.
Declaration
func constraint(equalToConstant c: CGFloat) -> NSLayoutConstraintParameters
- c:
A constant representing the size of the attribute associated with this dimension anchor.
Return Value
An NSLayoutConstraint object that defines a constant size for the attribute associated with this dimension anchor.
Discussion
This method defines the relationship first attribute = c. Where first attribute is the layout attribute represented by the anchor receiving this method call.
The constraints produced by the following two examples are identical.
See Also
Building constraints
constraint(equalTo:multiplier:)constraint(equalTo:multiplier:constant:)constraint(greaterThanOrEqualTo:multiplier:)constraint(greaterThanOrEqualTo:multiplier:constant:)constraint(greaterThanOrEqualToConstant:)constraint(lessThanOrEqualTo:multiplier:)constraint(lessThanOrEqualTo:multiplier:constant:)constraint(lessThanOrEqualToConstant:)