How spaceunlimited/privacy-invading-smart-glasses-halloween-costume works
Purpose and Platform
A native SwiftUI iPad/iOS costume-prop app that presents a live camera feed and on-device Apple Speech transcription in a “smart glasses” display. It uses Apple frameworks rather than a backend or custom external service. Project entry/build definition is Privacy Invading Smart Glasses.xcodeproj/project.pbxproj; runtime privacy declarations are expected in Privacy-Invading-Smart-Glasses-Info.plist.
Application Entry and Composition
Privacy Invading Smart Glasses/Privacy_Invading_Smart_GlassesApp.swift is the SwiftUI application entry point and creates the root UI. Privacy Invading Smart Glasses/ContentView.swift composes the primary screen, connecting camera and speech state to the glass-style interface. This is a single-client app with no server-side layer evident.
Camera Capture Domain
Privacy Invading Smart Glasses/CameraManager.swift owns camera discovery, capture-session lifecycle, permission handling, and switching between available cameras. It is the boundary to AVFoundation and must accommodate both built-in cameras and externally attached USB/UVC devices as exposed by iPadOS. Camera control/state should remain centralized here rather than embedded in SwiftUI views.
Camera Rendering Boundary
Privacy Invading Smart Glasses/CameraPreviewView.swift adapts the AVFoundation camera preview into the SwiftUI hierarchy. The control path is UI action → CameraManager session/device update → preview-layer output → SwiftUI-hosted preview. This separation keeps capture/session work outside declarative rendering and permits UI overlays without altering the video pipeline.
Speech Recognition Domain
Privacy Invading Smart Glasses/SpeechRecognitionManager.swift encapsulates authorization, audio capture/recognition lifecycle, and live transcription state using Apple’s Speech framework. Its flow is microphone input → Speech recognition request/task → recognized text published to the UI. Speech is a distinct permission and runtime boundary from camera capture, despite both being surfaced by ContentView.
UI State and User Interaction
Privacy Invading Smart Glasses/ContentView.swift is the orchestration surface for the live preview, transcription display, camera-selection controls, and visual glass treatment. It should observe manager-owned state and issue high-level start/stop/switch commands; it should not directly manage AVFoundation sessions or Speech recognition tasks.
Runtime and Device Dependencies
Material dependencies are SwiftUI for presentation, AVFoundation for video capture, and Speech for transcription; microphone/audio capture is implicitly required by the Speech pipeline. The app depends on iPadOS device permissions for camera, microphone, and speech recognition, plus physical USB-C power/data infrastructure when using external webcams. Asset branding is contained in Privacy Invading Smart Glasses/Assets.xcassets.
Main entry points: ContentView.swift Smart Glasses Screen · CameraManager.swift Camera Manager · SpeechRecognitionManager.swift Speech Manager · CameraPreviewView.swift Camera Preview
Components 13
SwiftUI App
- Xcode Project
Privacy Invading Smart Glasses.xcodeproj/project.pbxproj - App Entry
Privacy Invading Smart Glasses/Privacy_Invading_Smart_GlassesApp.swift - Smart Glasses Screen · Composes preview, transcription, and camera controls.
Privacy Invading Smart Glasses/ContentView.swift - Brand Assets
Privacy Invading Smart Glasses/Assets.xcassets
Camera Capture
- Camera Manager · Owns camera permission, session lifecycle, and device switching.
Privacy Invading Smart Glasses/CameraManager.swift - Camera Preview · Hosts the AVFoundation preview layer in SwiftUI.
Privacy Invading Smart Glasses/CameraPreviewView.swift - Built-in / USB Cameras · Includes iPad cameras and attached UVC webcams exposed by iPadOS.
Live Transcription
- Speech Manager · Owns authorization, audio capture, and live recognition lifecycle.
Privacy Invading Smart Glasses/SpeechRecognitionManager.swift - Microphone Input
iPadOS Frameworks
- Apple Speech
- AVFoundation
- SwiftUI
- iPadOS Permissions · Camera, microphone, and speech-recognition access.
Privacy-Invading-Smart-Glasses-Info.plist
Connections 15
- Xcode Project → App Entry: builds
- App Entry → Smart Glasses Screen: creates
- Smart Glasses Screen → Camera Manager: camera commands/state
- Smart Glasses Screen → Camera Preview: hosts
- Smart Glasses Screen → Speech Manager: speech commands/text
- Smart Glasses Screen → Brand Assets: uses
- Camera Manager → Built-in / USB Cameras: discovers and selects
- Camera Manager → AVFoundation: manages capture session
- Camera Manager → Camera Preview: preview-layer output
- Camera Preview → SwiftUI: adapts into
- Speech Manager → Microphone Input: captures audio
- Speech Manager → Apple Speech: submits recognition request
- Apple Speech → Smart Glasses Screen: recognized text
- Camera Manager → iPadOS Permissions: requests camera access
- Speech Manager → iPadOS Permissions: requests microphone and speech access