Attempted fix for macOS preview warning about containerBackgroundApi

This commit is contained in:
Shawn 2023-11-07 17:38:44 -07:00
parent 00847778f5
commit c4f4c1a05a

View File

@ -52,7 +52,7 @@ struct GaugeProgressStyle: ProgressViewStyle {
// iOS 17 while still supporting iOS 16 and less (https://nemecek.be/blog/192/hotfixing-widgets-for-ios-17-containerbackground-padding) // iOS 17 while still supporting iOS 16 and less (https://nemecek.be/blog/192/hotfixing-widgets-for-ios-17-containerbackground-padding)
extension View { extension View {
func widgetBackground(_ backgroundView: some View) -> some View { func widgetBackground(_ backgroundView: some View) -> some View {
if #available(iOSApplicationExtension 17.0, *) { if #available(iOSApplicationExtension 17.0, iOS 17.0, macOSApplicationExtension 14.0, *) {
return containerBackground(for: .widget) { return containerBackground(for: .widget) {
backgroundView backgroundView
} }