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.
Declaration
@MainActor @preconcurrency func backgroundExtensionEffect() -> some View
Discussion
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.