I'm seeing a camera preview rotation issue on iPadOS 27 that depends only on the SDK the app is linked against. I've filed it as FB25106148 and wanted to share it in case others hit the same problem.
Sample project: https://github.com/bc-lee/avfoundation-rotation-coordinator-discrete-resizing-poc
Setup
- Portrait-only iPad app with
UIRequiresFullScreen = YES - Front camera
AVCaptureVideoPreviewLayer, rotated withAVCaptureDevice.RotationCoordinator, as in the AVCam sample:
let coordinator = AVCaptureDevice.RotationCoordinator(device: device, previewLayer: previewLayer)
// On every change of videoRotationAngleForHorizonLevelPreview:
previewLayer.connection?.videoRotationAngle = coordinator.videoRotationAngleForHorizonLevelPreview
- iPad Pro 11-inch (4th generation), iPadOS 27.0.1, Stage Manager on, Rotation Lock off
What happens after rotating the iPad from portrait to landscape
| App UI | Stays upright for the user, letterboxed | Stays in portrait and lies on its side with the device (discrete resizing, TN3192) |
videoRotationAngleForHorizonLevelPreview | 180° | 180° |
| Camera preview | Upright | Sideways |
The source code and Info.plist are the same for both builds. interfaceOrientation, effectiveGeometry, window and screen bounds, and isInterfaceOrientationLocked are also identical between the two builds, so I couldn't find a public value that tells the two presentations apart.
In the iOS 27 SDK build, applying videoRotationAngleRelative(toDeviceOrientation:) (new in iOS 27) for the scene's interface orientation, which gives 90°, instead of the horizon-level preview angle restores an upright preview.
Questions
- Is
videoRotationAngleForHorizonLevelPreviewexpected to reflect the discrete resizing presentation in iPadOS 27? - Until that is resolved, is using
videoRotationAngleRelative(toDeviceOrientation:)with the scene's interface orientation, only when linked against the iOS 27 SDK and running on iOS 27, a reasonable workaround?
Has anyone else seen this, or found a better approach?