diff --git a/KisaniCal/ISSUES.md b/KisaniCal/ISSUES.md index 395e4fc..c7c2b3b 100644 --- a/KisaniCal/ISSUES.md +++ b/KisaniCal/ISSUES.md @@ -2229,3 +2229,24 @@ unwanted friction, not a fix — restored the KC-52 behavior where Finish skips the dialog only when `done == total` (nothing to override at that point). Partial-completion "Finish Anyway" still confirms. The always-visible progress dots from this issue's first change are untouched. + +## KC-64 — Xcode warning: deprecated `Activity.end(using:dismissalPolicy:)` + +Status: Implemented (not build-verified — no iOS runtime here) +Reported by: User, Xcode warning screenshot ("'end(using:dismissalPolicy:)' +was deprecated in iOS 16.2: Use end(content:dismissalPolicy:)") +Area: Live Activities + +### Description +Both Live Activity "stop" call sites called `activity.end(dismissalPolicy: +.immediate)` with no content argument. ActivityKit has two overloads — +`end(_:dismissalPolicy:)` (current) and the deprecated `end(using: +dismissalPolicy:)` — and omitting the first argument entirely resolved to +the deprecated one. + +### Change +Pass `nil` explicitly as the unlabeled first argument so it binds to the +non-deprecated overload: `activity.end(nil, dismissalPolicy: .immediate)`. + +Files: `KisaniCal/Managers/LiveActivityManager.swift`, +`KisaniCalWidgets/StopCountdownIntent.swift`. diff --git a/KisaniCal/Managers/LiveActivityManager.swift b/KisaniCal/Managers/LiveActivityManager.swift index 0723c76..2756377 100644 --- a/KisaniCal/Managers/LiveActivityManager.swift +++ b/KisaniCal/Managers/LiveActivityManager.swift @@ -61,7 +61,7 @@ enum LiveActivityManager { Task { for activity in Activity.activities where activity.attributes.taskID == taskID { - await activity.end(dismissalPolicy: .immediate) + await activity.end(nil, dismissalPolicy: .immediate) } } } diff --git a/KisaniCalWidgets/StopCountdownIntent.swift b/KisaniCalWidgets/StopCountdownIntent.swift index fc2fcf8..8e10da6 100644 --- a/KisaniCalWidgets/StopCountdownIntent.swift +++ b/KisaniCalWidgets/StopCountdownIntent.swift @@ -19,7 +19,7 @@ struct StopCountdownIntent: LiveActivityIntent { func perform() async throws -> some IntentResult { for activity in Activity.activities where activity.attributes.taskID == taskID { - await activity.end(dismissalPolicy: .immediate) + await activity.end(nil, dismissalPolicy: .immediate) } return .result() }