From 142b9c68108eca1ccb42ccd720adcf4f7f8bddcd Mon Sep 17 00:00:00 2001 From: Riley Testut Date: Thu, 7 Dec 2023 16:39:13 -0600 Subject: [PATCH] [AltWidget] Fixes compiling for iOS 16 and earlier Also fixes unused variable warnings. --- AltWidget/Widgets/ActiveAppsWidget.swift | 1 + AltWidget/Widgets/AppDetailWidget.swift | 3 ++- AltWidget/Widgets/LockScreenWidget.swift | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/AltWidget/Widgets/ActiveAppsWidget.swift b/AltWidget/Widgets/ActiveAppsWidget.swift index 643a0555..412de6fc 100644 --- a/AltWidget/Widgets/ActiveAppsWidget.swift +++ b/AltWidget/Widgets/ActiveAppsWidget.swift @@ -147,6 +147,7 @@ private struct ActiveAppsWidgetView: View } } +@available(iOS 17, *) #Preview(as: .systemMedium) { return ActiveAppsWidget() } timeline: { diff --git a/AltWidget/Widgets/AppDetailWidget.swift b/AltWidget/Widgets/AppDetailWidget.swift index 64e48405..a893989b 100644 --- a/AltWidget/Widgets/AppDetailWidget.swift +++ b/AltWidget/Widgets/AppDetailWidget.swift @@ -171,11 +171,12 @@ private extension AppDetailWidgetView } } +@available(iOS 17, *) #Preview(as: .systemSmall) { AppDetailWidget() } timeline: { let expiredDate = Date().addingTimeInterval(1 * 60 * 60 * 24 * 7) - let (altstore, delta, clip, _, longDelta, _) = AppSnapshot.makePreviewSnapshots() + let (altstore, delta, _, _, longDelta, _) = AppSnapshot.makePreviewSnapshots() AppsEntry(date: Date(), apps: [altstore]) AppsEntry(date: Date(), apps: [delta]) diff --git a/AltWidget/Widgets/LockScreenWidget.swift b/AltWidget/Widgets/LockScreenWidget.swift index 522ea037..5cd35901 100644 --- a/AltWidget/Widgets/LockScreenWidget.swift +++ b/AltWidget/Widgets/LockScreenWidget.swift @@ -136,6 +136,7 @@ private struct ComplicationView: View private let widgetFamily = if #available(iOS 16, *) { WidgetFamily.accessoryCircular } else { WidgetFamily.systemSmall } +@available(iOS 17, *) #Preview("Text", as: widgetFamily) { TextLockScreenWidget() } timeline: { @@ -148,6 +149,7 @@ private let widgetFamily = if #available(iOS 16, *) { WidgetFamily.accessoryCirc AppsEntry(date: expiredDate, apps: [altstore]) } +@available(iOS 17, *) #Preview("Icon", as: widgetFamily) { IconLockScreenWidget() } timeline: {