<!--
{
  "availability" : [
    "macOS: 15.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/WindowPlacement/init(x:y:width:height:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI15WindowPlacementV1x1y5width6heightAC14CoreFoundation7CGFloatVSg_A3Ktcfc"
  },
  "title" : "init(x:y:width:height:)"
}
-->

# init(x:y:width:height:)

Creates a new window placement with an optional position and size.

```
init(x: CGFloat? = nil, y: CGFloat? = nil, width: CGFloat? = nil, height: 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)