Contents

ControlWidgetConfigurationBuilder

A custom attribute that constructs a control widget’s body.

Declaration

@resultBuilder struct ControlWidgetConfigurationBuilder

Overview

The @ControlWidgetConfigurationBuilder attribute allows your control widget’s body closure to produce a control widget configuration after zero or more other statements:

struct GarageDoorOpener: ControlWidget {
    var body: some ControlWidgetConfiguration {
        let kind = "com.yourcompany.GarageDoorOpener"

        StaticControlConfiguration(
            kind: kind
        ) {
            ...
        }
    }
}

Topics

Type Methods

See Also

Composing control widgets