<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/Scene/defaultSize(_:)-4w9ac",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI5ScenePAAE11defaultSizeyQrSo8SPSize3DaF"
  },
  "title" : "defaultSize(_:)"
}
-->

# defaultSize(_:)

Sets a default size for a volumetric window.

```
nonisolated func defaultSize(_ size: Size3D) -> some Scene
```

## Parameters

`size`

The default 3D size for the created window.

## Return Value

A scene that uses a default size for new windows.

## Discussion

Use this modifier to indicate the default initial size for a new 3D
window created from a `Scene` using `VolumetricWindowStyle`:

```
WindowGroup {
    ContentView()
}
.windowStyle(.volumetric)
.defaultSize(Size3D(width: 600, height: 400, depth: 600))
```

Each parameter is specified in points. The size of a volumetric
scene is immutable after creation.

This modifier affects only windows that have the volumetric style in visionOS.

---

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)