Contents

ViewSpacing

A collection of the geometric spacing preferences of a view.

Declaration

struct ViewSpacing

Overview

This type represents how much space a view prefers to have between it and the next view in a layout. The type stores independent values for each of the top, bottom, leading, and trailing edges, and can also record different values for different kinds of adjacent views. For example, it might contain one value for the spacing to the next text view along the top and bottom edges, other values for the spacing to text views on other edges, and yet other values for other kinds of views. Spacing preferences can also vary by platform.

Your Layout type doesn’t have to take preferred spacing into account, but if it does, you can use the spacing preferences of the subviews in your layout container to:

Topics

Creating spacing instances

Measuring spacing distance

Merging spacing instances

See Also

Configuring a custom layout