watchOS 10 - Possible to distinguish between widget on a watchface vs. in a smart stack?

156 views Asked by At

I am building a watchOS 10 app with widgets, and I can't find a way to distinguish between a widget on a watchface vs. in a smart stack. Both have family = .accessoryRectangular, but each have a different expectation, the watchface widgets are usually more minimal, while the smart stack widgets have a full color background.

1

There are 1 answers

0
Tomáš Kafka On

It seems like

@Environment(\.showsWidgetContainerBackground) var showsWidgetContainerBackground: Bool

is the only flag that can distinguish these (true in smart stack, false on the watchface). Found in https://developer.apple.com/videos/play/wwdc2023/10027/