persistentSystemOverlays
Sets the preferred visibility of the non-transient system views overlaying the app.
Declaration
compose().persistentSystemOverlays(
visibility: SwiftUI.Visibility
)nonisolated func persistentSystemOverlays(
_ visibility: Visibility
) -> some ViewParameters
visibility*SwiftUI.VisibilityA value that indicates the visibility of the
Discussion
Use this modifier to influence the appearance of system overlays in your app. The behavior varies by platform.
In iOS, the following example hides every persistent system overlay.
In visionOS 2 and later, the SharePlay Indicator hides if the
scene is shared through SharePlay, or not shared at all.
During screen sharing, the indicator always remains visible.
The Home indicator doesn't appear without specific user intent
when you set visibility to Visibility.hidden. For a WindowGroup,
the modifier affects the visibility of the window chrome. For an
ImmersiveSpace, it affects the Home indicator.
struct ImmersiveView: View {
var body: some View {
Text("Maximum immersion")
.persistentSystemOverlays(.hidden)
}
}might or might not be able to honor that preference.
Affected non-transient system views can include, but are not limited to:
- The Home indicator.
- The SharePlay indicator.
- The Multitasking Controls button and Picture in Picture on iPad.
non-transient system views overlaying the app.
See also
More in Other modifiers.
- contentMarginsConfigures the content margin for a provided placement.
- idBinds a view's identity to the given proxy value.
- modifierApplies a modifier to a view and returns a new view.
- renameActionSets the rename action in the environment to update focus state.
- tagSets the unique tag value of this view.
- typeSelectEquivalentSets an explicit type select equivalent text in a collection, such as a list or table.