how to get notified when window size changes w app running on Mac

I have a swiftui iPhone app running on the "iOS Apps on Mac" simulator. What I'm trying to do is get a notification when the window size changes, but nothing seems to work.

I have tried

.onReceive(NotificationCenter.default.publisher(for: UIContentSizeCategory.didChangeNotification)) { _ in updateStuff() } I also tried

.onAppear() { updateStuff() }

but neither seems to get called

any suggestions ?