iPhone Duo Developer Hub · Blog

Build a Great Camera Experience for iPhone Duo

Apple Developer session · 9m 28s · Watch on YouTube ↗

Build a Great Camera Experience for iPhone Duo

Source: Build a great camera experience for iPhone Duo (Apple Developer) · 9 min 28s

By Tarun (Camera Software team).

iPhone Duo has two front cameras — a fact that breaks the "front = facing you" assumption and needs a plan. This session covers the new cameras, how to handle direction changes as people open/close the device, and how to polish your preview.

Two front cameras

Both are square sensors with an ultrawide field of view:

Your app streams from them through AVFoundation, same as always — request .front + Wide/UltraWide device type via AVCaptureDeviceDiscoverySession.

The Virtual Front Camera does the heavy lifting

When you discover the .front camera on Duo, you get a new Virtual Front Camera: a device that automatically switches between the outer and inner physical cameras so you're always streaming from the most relevant one (inner when open, outer when closed). You don't have to do anything.

Trade-off: the virtual camera only exposes features common to both — max 1080p @ 60fps, and no depth. If you need the full capabilities, use the individual device types (builtInOuterUltraWideCamera, builtInInnerUltraWideCamera) — but then you must handle the switching when the device opens/closes.

Direction: cameras don't always face you anymore

Here's the twist: with two displays that can face opposite ways, a "front" camera isn't always looking at you. Example: you read the inner display while streaming from the outer front camera — that camera is now facing away. Then if you close the device, that same camera swings around to face you.

So AVCaptureDevice.position == .front is no longer a guarantee it's forward-facing. Solve it with the new AVCaptureDeviceDirectionCoordinator (in AVKit):

```swift

// The change handler tells you which camera is now forward-facing

coordinator.onFacingChange = { facing in

// reconfigure your AVCaptureSession to stream from the forward-facing camera

// re-decide preview mirroring (mirror for a natural selfie)

// do any UI updates for the camera switch

}

```

Two implementation notes:

Polish the preview


Next steps

  1. Build with the iOS 27.1 SDK.
  2. Decide switching strategy: use the Virtual Front Camera (zero work, capped 1080p/60) or individual cameras + a direction coordinator (full capability, you manage the switch).
  3. Test the preview in every pose on the real device/simulator.

Two-display camera UI (CameraCaptureAccessory) is covered in "Leverage multiple displays and scenes on iPhone Duo."

Videos · Specs · Prices · Apps

Unofficial dev hub. Not affiliated with, endorsed by, or sponsored by Apple Inc.