glassBackgroundEffect(_:in:displayMode:)
Fills the view’s background with a custom glass background effect and a shape that you specify.
Declaration
nonisolated func glassBackgroundEffect<T, S>(_ effect: S, in shape: T, displayMode: GlassBackgroundDisplayMode = .always) -> some View where T : InsettableShape, S : GlassBackgroundEffect
Parameters
- effect:
A Glassbackgroundeffect instance that SwiftUI uses to the fill the background shape that you specify.
- shape:
An Insettableshape instance that SwiftUI draws behind the view.
- displayMode:
When to display the glass background. The default is Always.
Return Value
A view with a glass background.