The answer I found to this is not really satisfying, but it works fine with SwiftUI.
Every time the variable isLuminanceReduced changes, the ExtensionDelegate also changes the app state and calls applicationWillResignActive().
So to keep backwards compatible I introduced a singleton class that just holds a Bool isOn:
class LuminanceReducedCompat: ObservableObject {
@Published var isOn: Bool = false
public static let shared = LuminanceReducedCompat()
private var notifcationObservers = [Any]()
private init() {}
}
Now you can change the isOn variable in the applicationWillResignActive().
On your SwiftUI views you can add a that object now as an observed object.
@ObservedObject var luminanceReducedCompat = LuminanceReducedCompat.shared
I know that's not really nice, but the best I found until now. I don't want to maintain 2 views that show the same.
I though about using a custom Environment Value that reflects the official watchOS 8 value, but I am not sure how to push this into the view stack correctly and update it.