Files
Spanish/Conjuga/ConjugaWidget/WidgetDataReader.swift
Trey t 4b467ec136 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>
2026-04-09 20:58:33 -05:00

17 lines
475 B
Swift

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