WidgetRenderingMode
Constants that indicate the rendering mode for a widget.
Declaration
struct WidgetRenderingModeMentioned in
Overview
The system can modify the appearance of accessory family widgets. For example, it renders widgets on the Lock Screen on iPhone using the vibrant mode, while it renders widget-based complications in watchOS using either the fullColor or accented modes, depending on the watch face and the user’s settings.
You can read the rendering mode from the environment values using the .widgetRenderingMode key.
@Environment(\.widgetRenderingMode) var widgetRenderingModeYou can then customize your widget’s design based on the rendering mode.
Topics
Rendering modes
See Also
Layout and presentation
Supporting additional widget sizesDisplaying the right widget backgroundOptimizing your widget for accented rendering mode and Liquid GlassAdding StandBy and CarPlay support to your widgetWidgetAccentedRenderingModeAccessoryWidgetBackgroundWidgetLocationwidgetAccentable(_:)widgetAccentedRenderingMode(_:)widgetRenderingModewidgetContentMarginswidgetshowsWidgetContainerBackground