constraint(equalTo:multiplier:)
Returns a constraint that defines the anchor’s size attribute as equal to the specified anchor multiplied by the constant.
Declaration
func constraint(equalTo anchor: NSLayoutDimension, multiplier m: CGFloat) -> NSLayoutConstraintParameters
- anchor:
A dimension anchor from an Nsview or Nslayoutguide object.
- m:
The multiplier constant for the constraint.
Return Value
An NSLayoutConstraint object that defines the attribute represented by this layout anchor as equal to the attribute represented by the anchor parameter multiplied by the m constant.
Discussion
This method defines the relationship first attribute = m * second attribute. Where first attribute is the layout attribute represented by the anchor receiving this method call, and second attribute is the layout attribute represented by the anchor parameter.
The constraints produced by the following two examples are identical.
See Also
Related Documentation
NSLayoutConstraint- Auto Layout Guide
NSLayoutAnchor
Building constraints
constraint(equalTo:multiplier:constant:)constraint(equalToConstant:)constraint(greaterThanOrEqualTo:multiplier:)constraint(greaterThanOrEqualTo:multiplier:constant:)constraint(greaterThanOrEqualToConstant:)constraint(lessThanOrEqualTo:multiplier:)constraint(lessThanOrEqualTo:multiplier:constant:)constraint(lessThanOrEqualToConstant:)