associatedtype Body : Widget
The type of widget that represents the content of the bundle.
struct WidgetBundleBuilder
A custom attribute that constructs a widget bundle’s body.
Availability 有効性
Technology
var body: Self.Body { get }
The order that the widgets appear in this property determines the order they are shown to the user when adding a widget. The following example shows how to use a widget bundle builder to define a body showing a game status widget first and a character detail widget second:
@main
struct GameWidgets: WidgetBundle {
var body: some Widget {
GameStatusWidget()
CharacterDetailWidget()
}
}
associatedtype Body : Widget
struct WidgetBundleBuilder