1
0
mirror of https://github.com/mastodon/mastodon-ios.git synced 2025-01-23 06:02:35 +01:00
mastodon-app-ufficiale-ipho.../WidgetExtension/View+WidgetBackground.swift
2024-02-20 18:28:54 +01:00

20 lines
497 B
Swift

// Copyright © 2024 Mastodon gGmbH. All rights reserved.
import SwiftUI
extension View {
func emptyWidgetBackground() -> some View {
widgetBackground(EmptyView())
}
func widgetBackground(_ backgroundView: some View) -> some View {
if #available(iOSApplicationExtension 17.0, *) {
return containerBackground(for: .widget) {
backgroundView
}
} else {
return background(backgroundView)
}
}
}