Protocol

WidgetBundle

A container used to expose multiple widgets from a single widget extension. 複数のウィジェットを単一のウィジェット拡張から露出するために使われるあるコンテナ。

Declaration 宣言

protocol WidgetBundle

Overview 概要

To support multiple types of widgets, add the @main attribute to a structure that conforms to WidgetBundle. For example, a game might have one widget to display summary information about the game and a second widget to display detailed information about individual characters.


@main
struct GameWidgets: WidgetBundle {
   var body: some Widget {
       GameStatusWidget()
       CharacterDetailWidget()
   }
}

Topics 話題

Implementing a Widget Bundle

Running a Widget Bundle

See Also 参照

Widgets