<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "visionOS: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/ImmersiveEnvironmentBehavior/replace",
  "metadataVersion" : "0.1.0",
  "role" : "Type Property",
  "symbol" : {
    "kind" : "Type Property",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI28ImmersiveEnvironmentBehaviorV7replaceACvpZ"
  },
  "title" : "replace"
}
-->

# replace

A behavior that replaces any currently opened immersive environment with
the new scene.

```
static var replace: ImmersiveEnvironmentBehavior { get }
```

## Discussion

Use this value with the [`immersiveEnvironmentBehavior(_:)`](/documentation/SwiftUI/Scene/immersiveEnvironmentBehavior(_:)) scene
modifier to define that the system should hide the system’s immersive
environment before opening the scene.

---

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)