<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "visionOS: 2.0.0 - 2.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/WindowPlacement/Position/replacing(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI15WindowPlacementV8PositionV9replacingyAeA0C5ProxyVFZ"
  },
  "title" : "replacing(_:)"
}
-->

# replacing(_:)

Positions the window in the same spot as an existing window, hiding
the old window in the process.

```
static func replacing(_ relativeWindow: WindowProxy) -> WindowPlacement.Position
```

## Parameters

`relativeWindow`

The existing window that the new window
will replace.

## Discussion

This will position the new window in the same location as the
specified existing window, and hide the old window. Closing the new
window will then result in the original window being shown again.

---

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)