Hi,
I have an iPhone App with an UIWindowScene and two UIWindow's(mainWindow and alertWindow). In the mainWindow I have the whole app and it is allowed to rotate. The alertWindow is a window to show alert's to the user on the top of the screen and I do not want that the content inside rotate.
I thought I may do:
override var supportedInterfaceOrientations: UIInterfaceOrientationMask {
return .portrait
}
And
override var shouldAutorotate: Bool {
return false
}
In the rootviewcontroller of alertWindow but after doing those changes the rootviewcontroller of mainWindow does not rotate until I do any navigation.
I have thought to have two UIWindowScene's (one per UIWindow) but as far I know iPhone app only supports one UIWindowScene.
So, how can I avoid rotation in the viewcontroller of alertWindow without losing the rotation on rootviewcontroller of mainWindow?
My viewcontroller is a UIHostingController, so I tried also to avoid from my SwiftUI view but I did not find any solution neither.
Thank you in advance