# WindowGroup

[SwiftUI](../..) ⟩ [app](..) ⟩ [windows]() ⟩ WindowGroup&#x20;

{% hint style="success" %}
A [scene](../scenes/scene) that presents <mark style="color:yellow;">a group of identically structured</mark> [windows](). Use a <mark style="color:purple;">`WindowGroup`</mark> as a [container](../../view/hierarchy/container) for a [view hierarchy](../../view/hierarchy) that your [app](..) presents.
{% endhint %}

```swift
@main
struct MailApp: App {
    var body: some Scene {
    
        // ⭐️ WindowGroup
        WindowGroup {
            // ⭐️ at least one view is needed inside `WindowGroup`,
            //    which acts as a container for your app's view hierarchy.
            MailViewer() 
        }
        
    }
}
```

{% tabs %}
{% tab title="📘 手冊" %}
* [SwiftUI](https://developer.apple.com/documentation/swiftui) ⟩ [Windows](https://developer.apple.com/documentation/swiftui/windows) ⟩ [WindowGroup](https://developer.apple.com/documentation/swiftui/windowgroup)&#x20;
{% endtab %}
{% endtabs %}

