Files
notes/Notes/AppServices/AppServices.swift
T
rzen 9b231a1978 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.
2026-07-14 20:30:46 -04:00

25 lines
701 B
Swift

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()
}
}