[AltWidget] Supports refreshing apps directly from home screen

This commit is contained in:
Riley Testut
2023-08-18 19:24:31 -05:00
parent ff3fb64277
commit 1940fbd60f
5 changed files with 90 additions and 3 deletions

View File

@@ -24,4 +24,33 @@ extension View
background(backgroundView)
}
}
@ViewBuilder
func invalidatableContentIfAvailable() -> some View
{
if #available(iOSApplicationExtension 17, *)
{
self.invalidatableContent()
}
else
{
self
}
}
@ViewBuilder
func activatesRefreshAllAppsIntent() -> some View
{
if #available(iOSApplicationExtension 17, *)
{
Button(intent: RefreshAllAppsWidgetIntent()) {
self
}
.buttonStyle(.plain)
}
else
{
self
}
}
}