<!--
{
  "availability" : [
    "iOS: 14.0.0 - 18.0.0",
    "iPadOS: 14.0.0 - 18.0.0",
    "macCatalyst: 14.0.0 - 18.0.0",
    "macOS: 11.0.0 - 15.0.0",
    "tvOS: 14.0.0 - 18.0.0",
    "visionOS: 1.0.0 - 2.0.0",
    "watchOS: 7.0.0 - 11.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/WindowGroup/init(id:content:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI11WindowGroupV2id7contentACyxGSS_xyXEtcfc"
  },
  "title" : "init(id:content:)"
}
-->

# init(id:content:)

Creates a window group with an identifier.

```
nonisolated init(id: String, @ContentBuilder content: () -> Content)
```

## Parameters

`id`

A string that uniquely identifies the window group. Identifiers
must be unique among the window groups in your app.

`content`

A closure that creates the content for each instance
of the group.

## Discussion

The window group uses the given view as a
template to form the content of each window in the group.

---

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)