In iOS 15 you can use Materials, like .ultraThinMaterial
.background(.ultraThinMaterial)
But from iOS 14 down, there is no SwiftUI way to achieve this, though it is possible to create an UIViewRepresentable and place it as a background.
Following code will create a UIViewRepresentable that you are able to use as a background: .systemUltraThinMaterial can be changed to any material
import SwiftUI
struct BlurView: UIViewRepresentable {
var style: UIBlurEffect.Style = .systemUltraThinMaterial
func makeUIView(context: Context) -> UIVisualEffectView {
return UIVisualEffectView(effect: UIBlurEffect(style: style))
}
func updateUIView(_ uiView: UIVisualEffectView, context: Context) {
uiView.effect = UIBlurEffect(style: style)
}
}
View extension (optional):
extension View {
func backgroundBlurEffect() -> some View {
self.background(BlurView())
}
}
Then use on a view like a pop up.
.background(BlurView())
or if used like extension
.backgroundBlurEffect()
See image