105 lines
3.4 KiB
Markdown
105 lines
3.4 KiB
Markdown
# BusinessCard
|
|
|
|
A SwiftUI iOS + watchOS app that creates and shares digital business cards with QR codes, quick share actions, customization, and contact tracking. Data syncs across devices via iCloud.
|
|
|
|
## Platforms
|
|
- iOS 26+
|
|
- watchOS 12+
|
|
- Swift 6.2
|
|
|
|
## Features
|
|
|
|
### My Cards
|
|
- Create and browse multiple cards in a carousel
|
|
- Create new cards with the "New Card" button
|
|
- Set a default card for sharing
|
|
- Preview bold card styles inspired by modern design
|
|
|
|
### Share
|
|
- QR code display for vCard payloads
|
|
- Share options: copy link, SMS, email, WhatsApp, LinkedIn
|
|
- **Track shares**: Record who received your card and when
|
|
- Placeholder actions for Apple Wallet and NFC (alerts included)
|
|
|
|
### Customize
|
|
- Theme picker with multiple color palettes (Coral, Midnight, Ocean, Lime, Violet)
|
|
- Layout picker for stacked, split, or photo style
|
|
- **Edit all card details**: Name, role, company, email, phone, website, location
|
|
- **Delete cards** you no longer need
|
|
|
|
### Contacts
|
|
- Track who you've shared your card with
|
|
- Search contacts using localized matching
|
|
- Shows last shared time and the card label used
|
|
- Swipe to delete contacts
|
|
|
|
### Widgets (Preview Only)
|
|
- Phone widget preview mock
|
|
- Watch widget preview mock
|
|
|
|
### watchOS App
|
|
- Shows the default card QR code
|
|
- Pick which card is the default on watch
|
|
- **Syncs with iPhone** via App Groups
|
|
|
|
## Data Sync
|
|
|
|
### iCloud Sync (iOS)
|
|
Cards and contacts are stored using SwiftData with CloudKit sync enabled. Your data automatically syncs across all your iPhones and iPads signed into the same iCloud account.
|
|
|
|
### iPhone to Watch Sync
|
|
The iPhone app syncs card data to the paired Apple Watch via App Groups. When you create, edit, or delete cards on your iPhone, the changes appear on your watch.
|
|
|
|
**Note**: The watch reads data from the iPhone. To update cards on the watch, make changes on the iPhone first.
|
|
|
|
## Architecture
|
|
- SwiftUI views are presentation only
|
|
- Shared app state uses `@Observable` classes on `@MainActor`
|
|
- SwiftData for persistence with CloudKit sync
|
|
- Protocol-oriented design for card data, sharing, contact tracking, and QR generation
|
|
- String Catalogs (`.xcstrings`) for localization (en, es-MX, fr-CA)
|
|
|
|
## Project Structure
|
|
- `BusinessCard/Models` — SwiftData card/contact models
|
|
- `BusinessCard/State` — observable app state (CardStore, ContactsStore)
|
|
- `BusinessCard/Services` — QR generation, share URLs, watch sync
|
|
- `BusinessCard/Views` — SwiftUI screens and components
|
|
- `BusinessCard/Design` — design constants and semantic colors
|
|
- `BusinessCard/Protocols` — protocol definitions
|
|
- `BusinessCardWatch/` — watchOS app target and assets
|
|
|
|
## Configuration
|
|
|
|
### Required Capabilities
|
|
|
|
**iOS Target:**
|
|
- iCloud (CloudKit enabled)
|
|
- App Groups (`group.com.mbrucedogs.BusinessCard`)
|
|
- Background Modes (Remote notifications)
|
|
|
|
**watchOS Target:**
|
|
- App Groups (`group.com.mbrucedogs.BusinessCard`)
|
|
|
|
### CloudKit Container
|
|
`iCloud.com.mbrucedogs.BusinessCard`
|
|
|
|
## Notes
|
|
- Share URLs are sample placeholders
|
|
- Wallet/NFC flows are stubs with alerts only
|
|
- Widget UI is a visual preview (not a WidgetKit extension)
|
|
- First launch creates sample cards for demonstration
|
|
|
|
## Running
|
|
Open `BusinessCard.xcodeproj` in Xcode and build the iOS and watch targets.
|
|
|
|
## Tests
|
|
Unit tests cover:
|
|
- vCard payload formatting
|
|
- Default card selection
|
|
- Contact search filtering
|
|
- Create, update, delete cards
|
|
- Contact tracking (new and existing contacts)
|
|
- Theme and layout assignment
|
|
|
|
Run tests with `Cmd+U` in Xcode.
|