Contents

constraint(lessThanOrEqualToConstant:)

Returns a constraint that defines the maximum size for the anchor’s size attribute.

Declaration

func constraint(lessThanOrEqualToConstant c: CGFloat) -> NSLayoutConstraint

Parameters

  • c:

    A constant representing the maximum size of the attribute associated with this dimension anchor.

Return Value

An NSLayoutConstraint object that defines a maximum 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