<!--
{
  "availability" : [
    "macOS: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSWindow/endSheet(_:)-6af2u",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "s:So8NSWindowC7SwiftUIE8endSheetyyAbCE07HostingE14RepresentationCy_xGAC4ViewRzlF"
  },
  "title" : "endSheet(_:)"
}
-->

# endSheet(_:)

Ends a SwiftUI hosted sheet presentation.

```
@MainActor @preconcurrency func endSheet<V>(_ host: NSWindow.HostingSheetRepresentation<V>) where V : View
```

## Discussion

If the hosting sheet representation was invalid or no longer presented,
no effect happens.

---

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)