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>
16 lines
540 B
Swift
16 lines
540 B
Swift
import AppIntents
|
|
import WidgetKit
|
|
|
|
struct NewWordIntent: AppIntent {
|
|
static let title: LocalizedStringResource = "New Word"
|
|
static let description: IntentDescription = "Show a different word of the day"
|
|
|
|
func perform() async throws -> some IntentResult {
|
|
let shared = UserDefaults(suiteName: "group.com.conjuga.app")
|
|
let current = shared?.integer(forKey: "wordOffset") ?? 0
|
|
shared?.set(current + 1, forKey: "wordOffset")
|
|
WidgetCenter.shared.reloadAllTimelines()
|
|
return .result()
|
|
}
|
|
}
|