Enable Mac Catalyst on both targets; make the widget intent parameter optional
Supported Destinations now includes Mac (Mac Catalyst) on the app and the widget extension. Catalyst requires the iPad device family, so both targets move to TARGETED_DEVICE_FAMILY "1,2". The first Catalyst build failed on CalendarSelectionIntent: WidgetConfigurationIntent requires every @Parameter to be optional, and the macOS SDK enforces that where the iOS one lets a bare array through. selectedCalendars is now optional. Behaviour is unchanged — the timeline provider already treated an empty selection as "show all calendars", so nil folds into the same path. Verified: builds for both Mac Catalyst and iOS Simulator. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -38,8 +38,8 @@ struct CalendarrTimelineProvider: AppIntentTimelineProvider {
|
||||
|
||||
private func filtered(_ snapshot: WidgetSnapshot?, by config: CalendarSelectionIntent) -> WidgetSnapshot? {
|
||||
guard let snapshot else { return nil }
|
||||
let ids = config.selectedCalendars.map { $0.id }
|
||||
guard !ids.isEmpty else { return snapshot } // empty = show all
|
||||
let ids = (config.selectedCalendars ?? []).map { $0.id }
|
||||
guard !ids.isEmpty else { return snapshot } // nothing selected = show all
|
||||
let keep = Set(ids)
|
||||
return WidgetSnapshot(
|
||||
writtenAt: snapshot.writtenAt,
|
||||
|
||||
Reference in New Issue
Block a user