25 lines
549 B
Swift
25 lines
549 B
Swift
import SwiftUI
|
|
import AppIntents
|
|
|
|
@main
|
|
struct BusinessCardWatchApp: App {
|
|
@State private var cardStore = WatchCardStore()
|
|
|
|
init() {
|
|
// Wire up WatchConnectivity to receive cards from iPhone
|
|
let store = cardStore
|
|
WatchConnectivityService.shared.onCardsReceived = { cards in
|
|
Task { @MainActor in
|
|
store.updateCards(cards)
|
|
}
|
|
}
|
|
}
|
|
|
|
var body: some Scene {
|
|
WindowGroup {
|
|
WatchContentView()
|
|
.environment(cardStore)
|
|
}
|
|
}
|
|
}
|