[AltWidget] Adopts containerBackground(for:) on iOS 17

This commit is contained in:
Riley Testut
2023-08-18 19:00:57 -05:00
parent e6b0c90c7a
commit ff3fb64277
3 changed files with 40 additions and 1 deletions

View File

@@ -0,0 +1,27 @@
//
// View+AltWidget.swift
// AltStore
//
// Created by Riley Testut on 8/18/23.
// Copyright © 2023 Riley Testut. All rights reserved.
//
import SwiftUI
extension View
{
@ViewBuilder
func widgetBackground(_ backgroundView: some View) -> some View
{
if #available(iOSApplicationExtension 17, *)
{
containerBackground(for: .widget) {
backgroundView
}
}
else
{
background(backgroundView)
}
}
}