<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/View/preferredSurroundingsEffect(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI4ViewPAAE27preferredSurroundingsEffectyQrAA0eF0VSgF"
  },
  "title" : "preferredSurroundingsEffect(_:)"
}
-->

# preferredSurroundingsEffect(_:)

Applies an effect to passthrough video.

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

## Parameters

`effect`

The effect that you want to apply.

## Return Value

A view that exhibits the specified preference.

## 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`](/documentation/SwiftUI/ImmersionStyle/mixed) immersion style by applying the
[`systemDark`](/documentation/SwiftUI/SurroundingsEffect/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.

---

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)