Contents

WidgetBundle

A container used to expose multiple widgets from a single widget extension.

Declaration

@MainActor @preconcurrency 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

Creating widgets