<!--
{
  "availability" : [
    "macOS: 15.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/View/windowDismissBehavior(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI4ViewPAAE21windowDismissBehavioryQrAA017WindowInteractionF0VF"
  },
  "title" : "windowDismissBehavior(_:)"
}
-->

# windowDismissBehavior(_:)

Configures the dismiss functionality for the window enclosing `self`.

```
nonisolated func windowDismissBehavior(_ behavior: WindowInteractionBehavior) -> some View
```

## Parameters

`behavior`

The dismiss behavior.

## Discussion

By default, the window dismiss functionality is determined by the scene,
as well as any modifiers applied to it.

You can use this modifier to override the default behavior.

For example, you can create a welcome workflow window which disables the
dismiss functionality:

```
struct MyApp: App {
    var body: some Scene {
        ...
        Window("Welcome", id: "welcome") {
            WelcomeView()
                .windowDismissBehavior(.disabled)
        }
    }
}
```

---

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)