I want to get notified when the watch app enters foreground. How to register for "willEnterForegroundNotification" in SwiftUI. Following is the code to register for the same in UIKit.
Text("Hello, World!")
.onReceive(NotificationCenter.default.publisher(for: UIApplication.willEnterForegroundNotification)) { _ in
print("Moving back to the foreground!")
}
On watchOS 7 and above