---
title: "preferredSurroundingsEffect(_:)"
framework: swiftui
role: symbol
role_heading: Instance Method
path: "swiftui/view/preferredsurroundingseffect(_:)"
---

# preferredSurroundingsEffect(_:)

Applies an effect to passthrough video.

## Declaration

```swift
nonisolated func preferredSurroundingsEffect(_ effect: SurroundingsEffect?) -> some View

```

## Parameters

- `effect`: The effect that you want to apply.

## Return Value

Return Value A view that exhibits the specified preference.

## Discussion

Discussion Use this modifier to indicate a preference for the appearance of passthrough video when displaying the modified view. For example, you can enhance the immersiveness of a scene that uses the default mixed immersion style by applying the systemDark preference to a view inside the scene: ImmersiveSpace(id: "orbit") {     Orbit()         .preferredSurroundingsEffect(.dark) } When the system presents the Orbit view in the above code, it also dims passthrough video. This helps to draw attention to the scene’s virtual content while still enabling people to remain aware of their surroundings. note: This modifier expresses a preference, but the system might not be able to honor it. Use a value of nil to indicate that you have no preference. You typically do this to counteract a preference expressed by a view lower in the view hierarchy.

## See Also

### Configuring passthrough

- [SurroundingsEffect](swiftui/surroundingseffect.md)
- [breakthroughEffect(_:)](swiftui/view/breakthrougheffect(_:).md)
- [BreakthroughEffect](swiftui/breakthrougheffect.md)
