WidgetBundleBuilder
A custom attribute that constructs a widget bundle’s body.
Declaration
@resultBuilder struct WidgetBundleBuilderOverview
Use the @WidgetBundleBuilder attribute to group multiple widgets listed in the body property of a widget bundle. For example, the following code defines a widget bundle that consists of two widgets.
@main
struct GameWidgets: WidgetBundle {
@WidgetBundleBuilder
var body: some Widget {
GameStatusWidget()
CharacterDetailWidget()
}
}