init
TypeScriptstatic init(): Promise<AccessoryWidgetBackground>Swift declaration@MainActor @preconcurrency init()Creates an instance of an accessory widget background.
struct · iOS 16.0+ · SDK 27.1
@MainActor @preconcurrency struct AccessoryWidgetBackgroundAn adaptive background view that provides a standard appearance based on the the widget's environment. Use this view to provide a standardized background for your accessory widgets. Place the view in a <doc://com.apple.documentation/documentation/swiftui/ZStack> behind your widget's content. ``` Swift ZStack { AccessoryWidgetBackground() VStack { Text("MON") .font(.caption) .widgetAccentable() Text("6") .font(.title) } } ``` The system only displays this view inside a ``WidgetKit/WidgetFamily/accessoryCircular``, ``WidgetKit/WidgetFamily/accessoryCorner``, or ``WidgetKit/WidgetFamily/accessoryRectangular`` widget. In any other context, the system displays an empty view instead.
static init(): Promise<AccessoryWidgetBackground>Swift declaration@MainActor @preconcurrency init()Creates an instance of an accessory widget background.
1 declarations were excluded from these bindings. Each reason comes from the generator or the iOS SDK compiler.
AccessoryWidgetBackground.body
This protocol needs associated types that cannot yet cross the bridge.