I am trying to build a landscape-only app in Xcode 13 and SwiftUI. I notice even if I have unchecked "Portrait" orientation, the app will still work in portrait mode. I am unable to force the app to work in landscape mode.
This is the Device Orientation Settings:
This is the simple hello world SwiftUI:
import SwiftUI
struct ContentView: View {
var body: some View {
Text("Hello, world!")
.padding()
}
}
struct ContentView_Previews: PreviewProvider {
static var previews: some View {
ContentView()
}
}
Expected:
"Hello world" rotated 90degree clockwise when device in portrait mode. Forcing user to rotate the device to landscape mode to view correctly.
Actual:
"Hello world" still renders correctly in portrait mode. Why?