Contents

splitArrangementLayoutSize(minWidth:idealWidth:maxWidth:minHeight:idealHeight:maxHeight:)

Sets the size constraints for a view in a split style arrangement view.

Declaration

nonisolated func splitArrangementLayoutSize(minWidth: CGFloat? = nil, idealWidth: CGFloat? = nil, maxWidth: CGFloat? = nil, minHeight: CGFloat? = nil, idealHeight: CGFloat? = nil, maxHeight: CGFloat? = nil) -> some View

Parameters

  • minWidth:

    A float value that specifies the minimum width in points for a horizontal split arrangement.

  • idealWidth:

    A float value that specifies the ideal width in points for a horizontal split arrangement.

  • maxWidth:

    A float value that specifies the maximum width in points for a horizontal split arrangement.

  • minHeight:

    A float value that specifies the minimum height in points for a vertical split arrangement.

  • idealHeight:

    A float value that specifies the ideal height in points for a vertical split arrangement.

  • maxHeight:

    A float value that specifies the maximum height in points for a vertical split arrangement.

Discussion

Use this modifier to specify the size of a view in a split arrangement, as the following example shows:

ArrangementView {
    PhotoView()
        .splitArrangementLayoutSize(
            minWidth: 200,
            idealWidth: 320,
            maxWidth: 400)
} secondary: {
    InfoView()
}
.arrangementViewStyle(.split)

The arrangement sizes the view with higher layoutPriority using its ideal size, clamped to the minimum and maximum values. The arrangement applies width constraints to horizontal arrangement layouts, and height constraints to vertical arrangement layouts.

See Also

Dynamically arranging a primary and secondary view