<!--
{
  "availability" : [
    "iOS: 18.0.0 -",
    "iPadOS: 18.0.0 -",
    "macCatalyst: 18.0.0 -",
    "macOS: 15.0.0 -",
    "tvOS: 18.0.0 -",
    "visionOS: 2.0.0 -",
    "watchOS: 11.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/Scene/windowManagerRole(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI5ScenePAAE17windowManagerRoleyQrAA06WindoweF0VF"
  },
  "title" : "windowManagerRole(_:)"
}
-->

# windowManagerRole(_:)

Configures the role for windows derived from `self` when
participating in a managed window context, such as full screen or
Stage Manager.

```
nonisolated func windowManagerRole(_ role: WindowManagerRole) -> some Scene
```

## Discussion

By default, the type of `Scene` and its placement within the app’s
definition will determine the behavior of its windows within a window
management context.

You can use this modifier to override the default behaivor.

For example, you can specify that a secondary `Window` scene should use
the principal behavior for full screen and Stage Manager:

```
struct MyApp: App {
    var body: some Scene {
        WindowGroup {
            ContentView()
        }
        Window("Organizer", id: "organizer") {
            OrganizerView()
        }
        .windowManagerRole(.principal)
    }
}
```

---

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)