---
title: close()
framework: appkit
role: symbol
role_heading: Instance Method
path: appkit/nswindowcontroller/close()
---

# close()

Closes the window if it was loaded.

## Declaration

```swift
func close()
```

## Discussion

Discussion Because this method closes the window without asking the user for confirmation, you usually do not invoke it when the Close menu command is chosen. Instead invoke NSWindow’s performClose(_:) on the receiver’s window.

## See Also

### Closing the Window

- [shouldCloseDocument](appkit/nswindowcontroller/shouldclosedocument.md)
