Adds iOS 16 Lock Screen widget

This commit is contained in:
Riley Testut
2022-08-17 15:33:13 -05:00
parent be80aa1512
commit c9d522fad5
4 changed files with 181 additions and 2 deletions

View File

@@ -173,8 +173,7 @@ struct Provider: IntentTimelineProvider
}
}
@main
struct AltWidget: Widget
struct HomeScreenWidget: Widget
{
private let kind: String = "AppDetail"
@@ -189,3 +188,35 @@ struct AltWidget: Widget
.description("View remaining days until your sideloaded apps expire.")
}
}
struct LockScreenWidget: Widget
{
private let kind: String = "LockAppDetail"
public var body: some WidgetConfiguration {
if #available(iOSApplicationExtension 16, *)
{
return IntentConfiguration(kind: kind,
intent: ViewAppIntent.self,
provider: Provider()) { (entry) in
ComplicationView(entry: entry)
}
.supportedFamilies([.accessoryCircular])
.configurationDisplayName("AltWidget")
.description("View remaining days until AltStore expires.")
}
else
{
return EmptyWidgetConfiguration()
}
}
}
@main
struct AltWidgets: WidgetBundle
{
var body: some Widget {
HomeScreenWidget()
LockScreenWidget()
}
}