When Apple implements a SwiftUIController to manage SwiftUI views ... just kidding. You need to implement an AppDelegate with the prefered interface orientations and set it as the app delegate for your swift ui application, hopefully it should work:
class AppDelegate: UIResponder, UIApplicationDelegate {
func application(_ application: UIApplication, supportedInterfaceOrientationsFor window: UIWindow?) -> UIInterfaceOrientationMask {
.portrait
}
}
Then in your swiftui @main app
import UIKit
import SwiftUI
@main
struct SampleApp: App {
@UIApplicationDelegateAdaptor var appDelegate: AppDelegate
var body: some Scene { ... }
}
With some work, you can begin to architect updates between the AppDelegate and the SwiftUI App into the SwiftUI Environment for all views to have whatever data you will need.
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags: