Instance Property

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 combine this anchor only with other NSLayoutXAxisAnchor anchors. For more information, see NSLayoutAnchor.