d8fc4696a8a9514dda1a30b5fac68a84e3aed1ef
The QR scanner sat on a silent black screen when the camera couldn't start: it called AVCaptureDevice.default(for: .video), got nil (e.g. on the Simulator, which has no camera), and bailed via an early guard with no UI feedback. It also never requested camera permission (a denied device stayed black with no recovery) and sized the preview layer only once in viewDidLoad. Now it gates on AVCaptureDevice authorization (requesting access when undetermined, surfacing a Settings link when denied), reports an "unavailable" state when there's no camera so the UI explains the black screen, and updates the preview frame in viewDidLayoutSubviews. Camera runs work on a background queue. Co-Authored-By: Claude Opus 4.8 <[email protected]>
Description
No description provided
2 MiB
Languages
Swift
100%