The app has two methods to rotate globally the whole application:
/// Changes the orientation to landscape right globally within the app.
public static func landscapeRight() {
if AppDelegate.orientationLock != .landscapeRight {
AppDelegate.orientationLock = .landscapeRight
UIDevice.current.setValue(UIInterfaceOrientation.landscapeRight.rawValue, forKey: "orientation")
UINavigationController.attemptRotationToDeviceOrientation()
}
}
/// Changes the orientation to portrait globally within the app.
public static func portrait() {
if AppDelegate.orientationLock != .portrait {
AppDelegate.orientationLock = .portrait
UIDevice.current.setValue(UIInterfaceOrientation.portrait.rawValue, forKey: "orientation")
UINavigationController.attemptRotationToDeviceOrientation()
}
}
So I was able to change the orientation for some screens (especially some that use the camera). But after iOS 15 update the rotation is not working properly anymore. Sometimes the app rotates but the screen seems to be divided into two parts and sometimes is not rotating at all.
Any ideas what could be the issue?