I'd like to override the style of the widget so that my user's preference of dark mode in the app can also apply in the widget.
In the main SwiftUI app I can use:
But I'm not sure how to use that within the Widget extension. Yes I could define alternative for every single color and piece of text, but even things like the widget system background change with light/dark mode all of which I've have to try to check for and adjust.
If I can override the user interface style, my widget would adjust automatically.
In the main SwiftUI app I can use:
Code Block SceneDelegate.shared?.window!.overrideUserInterfaceStyle = .dark
But I'm not sure how to use that within the Widget extension. Yes I could define alternative for every single color and piece of text, but even things like the widget system background change with light/dark mode all of which I've have to try to check for and adjust.
If I can override the user interface style, my widget would adjust automatically.