I'm having trouble with XCode Simulator and device rotation using SwiftUI app. (Simulator Version 14.3.1 (994) SimulatorKit 629 CoreSimulator 885.2)
The horizontalSizeClass/verticalSizeClass as reported by simulator does not match the sizes given in https://developer.apple.com/design/human-interface-guidelines/layout when rotating the device.
It is correct on initial start, but on first device rotation (say e.g. portrait to landscape orientation) the values remain the same, despite monitoring with .onChange suggesting that they have changed! Then it appears to lag one device rotation behind the actual orientation for subsequent rotations. Such that on second device rotation (say landscape back to portrait) the values change to those associated with landscape instead of portrait - and so on for all subsequent rotations.
It's a particular issue with "large" iPhones when simulator gives width = .compact and height = .regular in landscape orentation when it should be the other way round!
Any insights from anyone as what is going on? Is it a bug or am I doing something wrong? Thanks