2
2
mirror of https://github.com/mastodon/mastodon-ios synced 2025-04-11 22:58:02 +02:00
mastodon-ios/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)
}
}
}