07b6769410d2d6c50057339760d6dd9922767b9b
Root cause (from on-device logs): the session was started from viewDidLoad while the pairing sheet was still presenting, so iOS interrupted it with reason 1 (videoDeviceNotAvailableInBackground) and it never ran (isRunning=false) — a black preview. The CMVideoFormatDescription -12710 errors were unrelated noise. Defer startRunning until the camera can actually run: configure the graph up front, then start only once the view is on screen and the app is foreground-active (viewDidAppear + a guarded startSessionIfReady). Recover on AVCaptureSessionInterruptionEnded / didBecomeActive / runtimeError. All start triggers funnel through the session queue and no-op if already running, so it's idempotent. Co-Authored-By: Claude Opus 4.8 <[email protected]>
Description
No description provided
2 MiB
Languages
Swift
100%