Instance Property インスタンスプロパティ

body

Declares the group of widgets that an app supports.

Declaration 宣言

var body: Self.Body { get }

Discussion 議論

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()
   }
}

See Also 参照

Implementing a Widget Bundle