init(in:content:)
Produces a view constrained in the given axes from one of several alternatives provided by a view builder.
Declaration
init(in axes: Axis.Set = [.horizontal, .vertical], @ViewBuilder content: () -> Content)Parameters
- axes:
A set of axes to constrain children to. The set may contain Horizontal, Vertical, or both of these.
ViewThatFitschooses the first child whose size fits within the proposed size on these axes. Ifaxesis an empty set,ViewThatFitsuses the first child view. By default,ViewThatFitsuses both axes. - content:
A view builder that provides the child views for this container, in order of preference. The builder chooses the first child view that fits within the proposed width, height, or both, as defined by
axes.