Contents

body

The content and behavior of the widget.

Declaration

@MainActor @preconcurrency var body: Self.Body { get }

Discussion

For any widgets that you create, provide a computed body property that defines the widget as a composition of SwiftUI views.

Swift infers the widget’s Body associated type based on the contents of the body property.

See Also

Implementing a widget