<!--
{
  "documentType" : "article",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/View-configuration",
  "metadataVersion" : "0.1.0",
  "role" : "collectionGroup",
  "title" : "View configuration"
}
-->

# View configuration

Adjust the characteristics of views in a hierarchy.

## Overview

SwiftUI enables you to tune the appearance and behavior of views using view
modifiers.

![](images/com.apple.SwiftUI/view-configuration-hero@2x.png)

Many modifiers apply to specific kinds of views or behaviors, but
some apply more generally. For example, you can conditionally hide any view
by dynamically setting its opacity, display contextual help when people hover
over a view, or request the light or dark appearance for a view.

## Topics

### Hiding views

[`func opacity(Double) -> some View`](/documentation/SwiftUI/View/opacity(_:))

Sets the transparency of this view.

[`func hidden() -> some View`](/documentation/SwiftUI/View/hidden())

Hides this view unconditionally.

### Hiding system elements

[`func labelsHidden() -> some View`](/documentation/SwiftUI/View/labelsHidden())

Hides the labels of any controls contained within this view.

[`func labelsVisibility(Visibility) -> some View`](/documentation/SwiftUI/View/labelsVisibility(_:))

Controls the visibility of labels of any controls contained within this
view.

[`var labelsVisibility: Visibility`](/documentation/SwiftUI/EnvironmentValues/labelsVisibility)

The labels visibility set by [`labelsVisibility(_:)`](/documentation/SwiftUI/View/labelsVisibility(_:)).

[`func menuIndicator(Visibility) -> some View`](/documentation/SwiftUI/View/menuIndicator(_:))

Sets the menu indicator visibility for controls within this view.

[`func statusBarHidden(Bool) -> some View`](/documentation/SwiftUI/View/statusBarHidden(_:))

Sets the visibility of the status bar.

[`func persistentSystemOverlays(Visibility) -> some View`](/documentation/SwiftUI/View/persistentSystemOverlays(_:))

Sets the preferred visibility of the non-transient system views
overlaying the app.

[`enum Visibility`](/documentation/SwiftUI/Visibility)

The visibility of a UI element, chosen automatically based on
the platform, current context, and other factors.

### Managing view interaction

[`func disabled(Bool) -> some View`](/documentation/SwiftUI/View/disabled(_:))

Adds a condition that controls whether users can interact with this
view.

[`var isEnabled: Bool`](/documentation/SwiftUI/EnvironmentValues/isEnabled)

A Boolean value that indicates whether the view associated with this
environment allows user interaction.

[`func interactionActivityTrackingTag(String) -> some View`](/documentation/SwiftUI/View/interactionActivityTrackingTag(_:))

Sets a tag that you use for tracking interactivity.

[`func invalidatableContent(Bool) -> some View`](/documentation/SwiftUI/View/invalidatableContent(_:))

Mark the receiver as their content might be invalidated.

### Providing contextual help

[`func help(_:)`](/documentation/SwiftUI/View/help(_:))

Adds help text to a view using a localized string resource that you
provide.

### Detecting and requesting the light or dark appearance

[`func preferredColorScheme(ColorScheme?) -> some View`](/documentation/SwiftUI/View/preferredColorScheme(_:))

Sets the preferred color scheme for this presentation.

[`var colorScheme: ColorScheme`](/documentation/SwiftUI/EnvironmentValues/colorScheme)

The color scheme of this environment.

[`enum ColorScheme`](/documentation/SwiftUI/ColorScheme)

The possible color schemes, corresponding to the light and dark appearances.

### Getting the color scheme contrast

[`var colorSchemeContrast: ColorSchemeContrast`](/documentation/SwiftUI/EnvironmentValues/colorSchemeContrast)

The contrast associated with the color scheme of this environment.

[`enum ColorSchemeContrast`](/documentation/SwiftUI/ColorSchemeContrast)

The contrast between the app’s foreground and background colors.

### Configuring passthrough

[`func preferredSurroundingsEffect(SurroundingsEffect?) -> some View`](/documentation/SwiftUI/View/preferredSurroundingsEffect(_:))

Applies an effect to passthrough video.

[`struct SurroundingsEffect`](/documentation/SwiftUI/SurroundingsEffect)

Effects that the system can apply to passthrough video.

[`func breakthroughEffect(BreakthroughEffect) -> some View`](/documentation/SwiftUI/View/breakthroughEffect(_:))

Ensures that the view is always visible to the user, even when other
content is occluding it, like 3D models.

[`struct BreakthroughEffect`](/documentation/SwiftUI/BreakthroughEffect)

The way a presentation shows through content in front of it.

### Redacting private content

  <doc://com.apple.documentation/documentation/watchOS-Apps/designing-your-app-for-the-always-on-state>

[Protecting sensitive content when screen sharing and remote control are active](/documentation/SwiftUI/Protecting-sensitive-content-when-screen-sharing)

Detect active screen capture sessions and respond appropriately to protect sensitive content in your app.

[`func privacySensitive(Bool) -> some View`](/documentation/SwiftUI/View/privacySensitive(_:))

Marks the view as containing sensitive, private user data.

[`func redacted(reason: RedactionReasons) -> some View`](/documentation/SwiftUI/View/redacted(reason:))

Adds a reason to apply a redaction to this view hierarchy.

[`func unredacted() -> some View`](/documentation/SwiftUI/View/unredacted())

Removes any reason to apply a redaction to this view hierarchy.

[`var redactionReasons: RedactionReasons`](/documentation/SwiftUI/EnvironmentValues/redactionReasons)

The current redaction reasons applied to the view hierarchy.

[`var isSceneCaptured: Bool`](/documentation/SwiftUI/EnvironmentValues/isSceneCaptured)

The current capture state.

[`struct RedactionReasons`](/documentation/SwiftUI/RedactionReasons)

The reasons to apply a redaction to data displayed on screen.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)