backgroundExtensionEffect
Adds the background extension effect to the view. The view will be duplicated into mirrored copies which will be placed around the view on any edge with available safe area. Additionally, a blur effect will be applied on top to blur out the copies.
Overloads
2 ways to call compose().backgroundExtensionEffect(). Each is one SwiftUI overload, picked by the arguments you pass.
compose().backgroundExtensionEffect()@MainActor @preconcurrency func backgroundExtensionEffect() -> some ViewDiscussion
Use this modifier when you want to extend the view beyond its bounds so the copies can function as backgrounds for other elements on top. The most common use case is to apply this to a view in the detail column of a navigation split view so it can extend under the sidebar or inspector region to provide seamless immersive visuals.
NavigationSplitView {
// sidebar content
} detail: {
ZStack {
BannerView()
.backgroundExtensionEffect()
}
}
.inspector(isPresented: $showInspector) {
// inspector content
}Apply this modifier with discretion. This should often be used with only a single instance of background content with consideration of visual clarity and performance.
overlapping with each other.
See also
More in Visual effects.
- allowedDynamicRangeReturns a new view configured with the specified allowed dynamic range.
- blurApplies a Gaussian blur to this view.
- brightnessBrightens this view by the specified amount.
- clippedClips this view to its bounding rectangular frame.
- colorEffectReturns a new view that applies shader to self as a filter effect on the color of each pixel.
- colorInvertInverts the colors in this view.
- colorMultiplyAdds a color multiplication effect to this view.
- compositingGroupWraps this view in a compositing group.
- contrastSets the contrast and separation between similar colors in this view.
- distortionEffectReturns a new view that applies shader to self as a geometric distortion effect on the location of each pixel.
- drawingGroupComposites this view's contents into an offscreen image before final display.
- glassEffectApplies a glass effect to this view.