AccessoryWidgetGroup
A view type that has a label at the top and three content views masked with a circle or rounded square.
Declaration
@MainActor @preconcurrency struct AccessoryWidgetGroup<Label, Content> where Label : View, Content : ViewOverview
You can use this view on .accessoryRectangular family widgets on watchOS to lay out three content views horizontally inside of a rectangular widget.
Example usage:
struct WeatherGroupView: View {
var entry: Provider.Entry
var body: some View {
AccessoryWidgetGroup("Weather", systemImage: "cloud.sun.fill") {
TemperatureWidgetView(entry.temperature)
ConditionsWidgetView(entry.conditions)
UVIndexWidgetView(entry.UVIndex)
}
.accessoryWidgetGroupStyle(.circular)
}
}The above example creates an .accessoryRectangular widget that has a SwiftUI.Label as its label and has three content views: temperature, conditions, and UVIndex; all of which are circular. If fewer than three views are provided, the content views are centered within the available space.
You can change the shape with which the content views are masked using the .accessoryWidgetGroupStyle(_:) view modifier.