Skip to content
iPhone Duo SupportGet help

Adopt AVCaptureDeviceRotationCoordinator

MajorNeeds iOS 27.1 SDKcamera

What you see

Captured photos or video come out rotated, or preview orientation disagrees with the saved file.

AVCaptureDeviceRotationCoordinator keeps capture orientation correct, and on iPhone Duo it updates as your app moves between displays — a transition that did not exist on any previous iPhone.

Adopt the coordinator

Adopt it for all capture outputs, then turn off the compatibility path it replaces:

class AVCapturePhotoOutput: AVCaptureOutput {
    var isCameraSensorOrientationCompensationEnabled: Bool { get set }
}

Apple’s guidance is to adopt the rotation coordinator and then disable sensor orientation compensation, which is a real performance gain: the system stops rotating buffers to compensate.

Order matters. Disabling compensation before the coordinator is correctly wired gives you rotated output. Adopt first, verify, then disable.

Preview layout

Two settings control how the preview fills a display that is a different shape from the sensor:

class AVCaptureVideoPreviewLayer {
    var videoGravity: AVLayerVideoGravity { get set }
}

class AVCaptureDevice {
    var dynamicAspectRatio: AVCaptureDevice.AspectRatio? { get }
}

Both front cameras have square sensors with an ultrawide field of view, so there is real latitude in what you present. Use dynamicAspectRatio on the ultrawide cameras to pick a landscape aspect ratio and fill the display.

Apple also recommends mirroring the preview when a rear camera is facing the subject, so a user framing a selfie on the cover display sees the mirrored image they expect.

How to verify

Capture a photo and a video in every pose and on both displays. Check orientation in the preview, in the saved file, and after sharing to another app. Rotate mid-recording and confirm the result is still correct.

← All checksGet help with this