Files
Spanish/Conjuga/ConjugaWidget/NewWordIntent.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

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