Initial commit: Conjuga Spanish conjugation app
Includes SwiftData dual-store architecture (local reference + CloudKit user data), JSON-based data seeding, 20 tense guides, 20 grammar notes, SRS review system, course vocabulary, and widget support. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
16
Conjuga/ConjugaWidget/WidgetDataReader.swift
Normal file
16
Conjuga/ConjugaWidget/WidgetDataReader.swift
Normal file
@@ -0,0 +1,16 @@
|
||||
import Foundation
|
||||
import SharedModels
|
||||
|
||||
struct WidgetDataReader {
|
||||
static let suiteName = "group.com.conjuga.app"
|
||||
static let dataKey = "widgetData"
|
||||
|
||||
static func read() -> WidgetData {
|
||||
guard let shared = UserDefaults(suiteName: suiteName),
|
||||
let data = shared.data(forKey: dataKey),
|
||||
let decoded = try? JSONDecoder().decode(WidgetData.self, from: data) else {
|
||||
return .placeholder
|
||||
}
|
||||
return decoded
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user