Contents

layoutProperties

Properties of a layout container.

Declaration

static var layoutProperties: LayoutProperties { get }

Discussion

Implement this property in a type that conforms to the Layout protocol to characterize your custom layout container. For example, you can indicate that your layout has a vertical stackOrientation:

extension BasicVStack {
    static var layoutProperties: LayoutProperties {
        var properties = LayoutProperties()
        properties.stackOrientation = .vertical
        return properties
    }
}

If you don’t implement this property in your custom layout, the protocol provides a default implementation, namely layoutProperties, that returns a LayoutProperties instance with default values.

See Also

Reporting layout container characteristics