---
title: "removeWindowController(_:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nsdocument/removewindowcontroller(_:)"
---

# removeWindowController(_:)

Removes the specified window controller from the receiver’s array of window controllers.

## Declaration

```swift
func removeWindowController(_ windowController: NSWindowController)
```

## Parameters

- `windowController`: The window controller that is removed.

## Discussion

Discussion A document with no window controllers is not necessarily closed. However, a window controller can be set to close its associated document when the window is closed or the window controller is deallocated. The default implementation of this method sends a document message to the passed-in window controller with a nil argument. You would not typically override this method.

## See Also

### Related Documentation

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

### Creating and Managing Window Controllers

- [makeWindowControllers()](appkit/nsdocument/makewindowcontrollers().md)
- [addWindowController(_:)](appkit/nsdocument/addwindowcontroller(_:).md)
- [windowControllers](appkit/nsdocument/windowcontrollers.md)
- [windowNibName](appkit/nsdocument/windownibname.md)
- [windowControllerDidLoadNib(_:)](appkit/nsdocument/windowcontrollerdidloadnib(_:).md)
- [windowControllerWillLoadNib(_:)](appkit/nsdocument/windowcontrollerwillloadnib(_:).md)
- [shouldCloseWindowController(_:delegate:shouldClose:contextInfo:)](appkit/nsdocument/shouldclosewindowcontroller(_:delegate:shouldclose:contextinfo:).md)
