Connections

Place connections between view names to specify the way a layout flows. An empty connection (in other words, one that has been omitted) means “follow on directly.”

The first constraint you saw for Figure 5-2, "H:[view1][view2]", uses an empty connection. There’s nothing specified between the square brackets of View 1 and the brackets of View 2. This tells the constraint to place View 2 directly to the right of View 1.

A hyphen (-) indicates a small fixed space. The constraint "H:[view1]-[view2]" uses a hyphen connection. This constraint leaves a standard (as defined by Apple) gap between View 1 and View 2, as shown in Figure 5-3.

Image

Get The Core iOS Developer’s Cookbook, Fifth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.