SwiftUI MVP for creating, editing, exporting (AirDrop) and importing digital business cards (JSON + PNG).
- SwiftUI App entry (
kardApp) - Model:
Card(+ Codable, timestamps) - Disk persistence: per-card JSON files + PNG image assets in Documents/cards/
- Image capture / selection with center-aspect crop (Scan workflow)
- Card creation & editing (fields, notes, color palette, image replace)
- Color palette utility + hex color support
- Share / AirDrop export (JSON + optional PNG) via
ShareExporter(temporary files under /tmp/kard-export) - Import (Document Picker: multi-select JSON (+ optional PNG) with UUID collision handled by generating new UUID and remapping image filename)
- Delete cards (with file cleanup)
- Basic accessibility labels on key buttons
Export
- In
CardDetailViewtap Share (square.and.arrow.up). - App generates
{name-or-uuid}.jsonand, if an image exists,{name-or-uuid}.pngin a fresh temporary directory. - A
UIActivityViewController(AirDrop-focused) is presented with those file URLs.
Import
- Tap the import button (square.and.arrow.down) on Home.
- Select one or more JSON files (optionally also select their PNG siblings). PNGs are ignored unless a JSON with the same stem is chosen.
- For each JSON: decode
Card; if its UUID already exists locally a new UUID is assigned (and image filename remapped). - If a matching PNG (same stem) exists it is copied into local storage; otherwise image reference is cleared.
- Result count or error is surfaced via alert.
- JSON:
Documents/cards/<uuid>.json - Images:
Documents/cards/<uuid>.png - Temp export:
tmp/kard-export/{stem}.json|png(recreated on each share)
- OCR / automatic data extraction
- Cloud sync / multi-device
- Advanced theming / multiple layout templates
- Onboarding & richer accessibility audit
- Unit/UI test suite
Open kard.xcodeproj in Xcode (iOS 15.6+ target) and run on device or simulator. AirDrop sharing requires a physical device.
ShareExporter.exportoverwrites the temp export folder each invocation to keep artifacts clean.- Import only processes files with
.jsonextension (extra selected PNGs are simply ignored unless their JSON counterpart is also chosen). - Collision strategy: generate new UUID; image filename becomes
<newUUID>.png.
TBD