Appendix H: Claudes LockBox (Shop Manual)

Status: v1.0 submitted to App Store APR 16 2026, awaiting review. GPL v3. Public repo at github.com/fluhartyml/Claudes-LockBox. Build-Along chapter: Part VII Build-Along 03. Claudes LockBox is a biometric vault for personal documents and photos: Face ID at launch, folders inside, items inside folders, attached camera shots or scanned PDFs at the item level. It's the Bible's primary Live Reference for gestures (Book 04), three-column navigation (Book 13), sheet vs. fullScreenCover (Book 12), and share-sheet integration (Book 14).

What it is

A SwiftUI iPhone / iPad / Mac (Designed for iPad on Mac) app that gates everything behind Face ID. After successful authentication, the user sees a sidebar of folders, the items inside the selected folder, and the per-item detail screen. Items hold photos taken with the camera, document pages scanned with VisionKit's document scanner, free-form text notes, and PIN-protected secure entries. The data lives in SwiftData, hosted in the app's sandbox — nothing leaves the device.

Architecture overview

Standard SwiftUI + SwiftData app with a Face-ID-gated entry view. Three-column NavigationSplitView after auth. Camera and document-scanner integrations are UIViewController-based, bridged into SwiftUI via UIViewControllerRepresentable.

File roles:

The Face ID gate

LockScreenView is the app's first surface after launch. It calls LAContext.evaluatePolicy(.deviceOwnerAuthenticationWithBiometrics, ...) with a localized reason string; success replaces the gate with ContentView. Failure shows the gate again with a retry affordance. There's a PIN fallback for devices without Face ID or when biometrics is unavailable.

The lock screen is part of the SwiftUI view tree (not a presentation modal). On app backgrounding the gate re-asserts via scene phase changes — switching to another app and back re-prompts.

Data model

Two SwiftData entities and the relationships between them:

The ModelContainer is wired in Claudes_LockBoxApp.swift. The .modelContainer(for: [Folder.self, VaultItem.self]) call seeds the SwiftData stack; the views read via @Query and write via @Environment(\.modelContext) with explicit insert/delete.

Gestures (Image Viewer)

ImageViewerView.swift hosts five gesture patterns in a single view, which is why Book 04 reaches for it as the chapter's worked example:

  1. Tap a thumbnail → image opens full-screen.
  2. Pinch → zoom in / out.
  3. Double-tap → toggle between fit-to-screen and 3x zoom.
  4. Drag (when zoomed in) → pan the image.
  5. Pinch below 1x → snap back to fit-to-screen.

Long-press on a thumbnail in the detail view presents a context menu with "View Full Size" and "Delete Page" options.

Sheets, alerts, share

Build + deployment

Known gotchas

Sources