---
title: "endSheet(_:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nswindow/endsheet(_:)-4dmmq"
---

# endSheet(_:)

Ends a document-modal session and dismisses the specified sheet.

## Declaration

```swift
func endSheet(_ sheetWindow: NSWindow)
```

## Parameters

- `sheetWindow`: The window object that represents the sheet to be dismissed.

## Discussion

Discussion This method ends the modal session with the return code NSModalResponseStop.

## See Also

### Managing Sheets

- [attachedSheet](appkit/nswindow/attachedsheet.md)
- [isSheet](appkit/nswindow/issheet.md)
- [beginSheet(_:completionHandler:)](appkit/nswindow/beginsheet(_:completionhandler:).md)
- [beginCriticalSheet(_:completionHandler:)](appkit/nswindow/begincriticalsheet(_:completionhandler:).md)
- [endSheet(_:returnCode:)](appkit/nswindow/endsheet(_:returncode:).md)
- [sheetParent](appkit/nswindow/sheetparent.md)
- [sheets](appkit/nswindow/sheets.md)
