<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "visionOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/WindowPlacement/init(_:width:height:depth:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI15WindowPlacementV_5width6height5depthA2C8PositionVSg_14CoreFoundation7CGFloatVSgA2Mtcfc"
  },
  "title" : "init(_:width:height:depth:)"
}
-->

# init(_:width:height:depth:)

Creates a new window placement with an optional position and 3D size.
Depth is ignored on scenes or platforms that don’t support it.

```
init(_ position: WindowPlacement.Position? = nil, width: CGFloat? = nil, height: CGFloat? = nil, depth: CGFloat? = nil)
```

## Discussion

Any values not provided will use use the default values for the `Scene`
that this placement is being applied to.

---

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)