Initial scaffold: context-aware notes app for iOS + macOS
XcodeGen project (Notes / NotesMac / NotesTests), Swift 6 strict concurrency, iCloud-document storage via IndieSync with a SwiftData cache, automatic capture context (location, place, time zone, device) on every note, context-based relevance ranking with a 'Right here, right now' shelf, tags, search, and the square.and.pencil-on-red app icon.
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
import Foundation
|
||||
import SwiftData
|
||||
|
||||
/// Owns all service objects; created asynchronously at launch and injected
|
||||
/// into the SwiftUI environment.
|
||||
@Observable
|
||||
@MainActor
|
||||
final class AppServices {
|
||||
let modelContainer: ModelContainer
|
||||
let syncEngine: SyncEngine
|
||||
let contextService: ContextService
|
||||
|
||||
init() async {
|
||||
let container = NotesModelContainer.make()
|
||||
self.modelContainer = container
|
||||
self.syncEngine = SyncEngine(modelContainer: container)
|
||||
self.contextService = ContextService()
|
||||
}
|
||||
|
||||
/// Slow startup work (iCloud container discovery) — runs after the UI is up.
|
||||
func startDeferredServices() async {
|
||||
await syncEngine.connect()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user