Contents

constraint(equalToConstant:)

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

Declaration

func constraint(equalToConstant c: CGFloat) -> NSLayoutConstraint

Parameters

  • 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