Ideally we'd have native iPad support, but that's a ways off and not feasible at the moment. So for now we have to work with iPad running the iPhone app. Hybrid Swift and Objective-C using UIKit, for context.
The app I'm working on has a camera view controller that, prior to iPadOS 15, would not rotate the field of view between portrait and landscape. However, with this new rotation behavior, the UI is shown in portrait when the iPad is in landscape. In the case of the camera, the field of view is now flipped 90º. The captured images are not flipped, but the sideways field of view isn't a good look.
What I've tried/observed so far is the following:
This new rotation behavior is not governed by the UIViewController's rotation methods. Overriding
shouldAutorotate
andsupportedInterfaceOrientations
does not prevent this rotation. So this is happening at the device level, and not the view controller level.At the device level, I only know of one way to programmatically change orientation, using the private setter on UIDevice's
orientation
property. Obviously, private APIs are a no-no for the App Store, and a hack to leverage them may break in the future. Not a good solution either.
At this point I'm at the end of my rope. I have scoured Google and StackOverflow to learn more about how this new feature works, at a technical level, but details are sparse. If anyone has more information or experience with this, that would be great. Even if the answer is 'no dice'. Thanks!