Instance Method

constraint(greaterThanOrEqualToSystemSpacingAfter:multiplier:)

Returns a constraint that defines the minimum amount by which the current anchor trails the specified anchor.

Declaration

func constraint(greaterThanOrEqualToSystemSpacingAfter anchor: NSLayoutXAxisAnchor, multiplier: CGFloat) -> NSLayoutConstraint

Parameters

anchor

The anchor to use as the starting point for the constraint.

multiplier

The multiple of the system spacing to use as the minimum distance between the two anchors.

Return Value

An NSLayoutConstraint object that imposes a minimum distance between the current anchor and the object in the anchor parameter.

Discussion

The constraint causes the current anchor to trail the object in the anchor parameter. For example, in a left-to-right layout, the current anchor is to the right of anchor, but in a right-to-left layout, it is to the left of anchor.

The minimum distance between the two anchors is determined by multiplying the system spacing by the value in the multiplier parameter. (The actual distance must be greater than or equal to that value.) The value of the system space is determined from information available from the anchors.

See Also

Building System Spacing Constraints

func constraint(equalToSystemSpacingAfter: NSLayoutXAxisAnchor, multiplier: CGFloat) -> NSLayoutConstraint

Returns a constraint that defines by how much the current anchor trails the specified anchor.

Creating Self-Sizing Table View Cells

Create table view cells that support Dynamic Type and use system spacing constraints to adjust the spacing surrounding text labels.