Contents

centerXAnchor

A layout anchor representing the horizontal center of the view’s frame.

Declaration

var centerXAnchor: NSLayoutXAxisAnchor { get }

Discussion

Use this anchor to create constraints with the view’s horizontal center. You can only combine this anchor with other NSLayoutXAxisAnchor anchors. For more information, see NSLayoutAnchor.

See Also

Creating Constraints Using Layout Anchors