Contents

constraint(equalTo:)

Returns a constraint that defines one item’s attribute as equal to another.

Declaration

func constraint(equalTo anchor: NSLayoutAnchor<AnchorType>) -> NSLayoutConstraint

Parameters

Return Value

An NSLayoutConstraint object that defines an equal relationship between the attributes represented by the two layout anchors.

Discussion

This method defines the relationship first attribute = 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

Building constraints