Use the Align tool () to quickly create distance and alignment constraints for one or more views.
In Interface Builder, select one or more views by clicking them in the outline view or on the canvas.
To select multiple views either:
Shift-click a range of views in the outline view
Command-click individual views in the outline view
Shift-click or Command-click individual views on the canvas
At the bottom of the canvas, click the Align tool button in the layout bar.
In the Align tool, set the properties for the constraints you want to add.
Create constraints to:
Align views to an edge: Select a type of edge (Leading Edges, Trailing Edges, Top Edges, or Bottom Edges).
Center views: Select a center option (Horizontal Centers, Vertical Centers, or Baselines). The Baselines option is available only when you select two or more items that all have baselines.
Center views in the container: Select “Horizontal Center in Container” or “Vertical Center in Container” or both.
Note: The Align tool enables only valid constraint options for the selected views.
In the adjacent text fields, enter an optional spacing in points.
From the Update Frames pop-up menu, choose an update option.
None: Don’t update any frames.
Update only the frames of the selected views: Choose “Items of New Constraints.”
Update the frames of all views in the container: Choose “All Frames in Container.”
Click Add Constraints (the title changes depending on the number of constraints you specify).
The constraints are added to the selected views and appear in the outline view. The canvas updates the Auto Layout lines and badges.