ibuildinpublic
Log inStart free
ibuildinpublic
Log inStart free
BuilderProductExperiences5Posts5

iPhone Duo Camera Apps: Virtual Front Camera and Direction Switching with AVFoundation

How to/GuideNov 5, 2026
Ehsan Azish

by Ehsan Azish

@ehsanazish80Lvl 5·Builder

Quick Answer

Keep the camera path you already use unless the product needs a capability that differs between iPhone Duo's two physical front cameras. A normal front-camera discovery session returns the Virtual Front Camera on Duo, and the system follows the app between the outer and inner displays. If capture is the product and you need the full resolution, frame-rate, or depth capabilities of a physical camera, discover those cameras directly and use AVCaptureDeviceDirectionCoordinator to determine which one faces the same direction as the preview.

Do not infer camera direction from .front or .back. On Duo, a camera's physical position stays constant while the display facing the user can change.

Requirements

  • Xcode 27.1 and the iOS 27.1 SDK for Duo-specific camera APIs.

  • A real AVCaptureSession architecture that keeps session mutation off the main actor.

  • A UIView associated with the preview. The direction coordinator uses this view as its frame of reference.

  • Camera permission copy and a usable denied-permission state.

Choose the Smallest Camera Strategy That Meets the Product Need

There are two legitimate paths:

| Strategy | Use it when | Tradeoff | |---|---|---| | Virtual Front Camera | Video calls, profile photos, document capture, or an existing front-camera flow | The system switches displays for you, but exposes only capabilities common to both front cameras | | Physical cameras plus direction coordinator | Camera creation is a primary feature and the app needs higher resolution, higher frame rate, depth, or deliberate rear-camera selfies | Your app owns camera selection, session reconfiguration, mirroring, and transition behavior |

Apple states that the inner front camera supports up to 1080p at 60 fps, while the outer front camera supports up to 4K at 120 fps. The virtual device therefore tops out at the shared 1080p/60-fps capability, and depth requires direct access to a physical camera. Treat those limits as a product decision before adding coordination code.

read the rest : https://3nsofts.com/guides/ios-layout/iphone-duo-camera-avfoundation

6likes2comments15Impressions
1Bookmark
Sign in to interact
Sign in to reply

2 replies

Mark Rosario
Mark Rosario@markrosarioLvl 7·Active Builder·Nov 6
The .front/.back warning is the part worth remembering — a camera's physical position stays constant while the display facing the user changes. That's the kind of bug that only shows up on the real device, in the user's hands.
comments1likes
Konstantinos G
Konstantinos G@emarkssLvl 5·Builder·Nov 5
“Do not infer camera direction from .front or .back” is the line that will save someone a bug report. A physical position that stays fixed while the display facing the user changes is exactly the kind of thing a quick answer needs. Clear guide.
comments1likes