<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSDocument/windowControllerWillLoadNib(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSDocument(im)windowControllerWillLoadNib:"
  },
  "title" : "windowControllerWillLoadNib(_:)"
}
-->

# windowControllerWillLoadNib(_:)

Called before one of the document’s window controllers loads its nib file.

```
func windowControllerWillLoadNib(_ windowController: NSWindowController)
```

## Parameters

`windowController`

The window controller that loads the nib file.

## Discussion

See the class description for [`NSWindowController`](/documentation/AppKit/NSWindowController) for additional information about nib files and the file’s owner object.

Typically an `NSDocument` subclass overrides [`windowNibName`](/documentation/AppKit/NSDocument/windowNibName) or [`makeWindowControllers()`](/documentation/AppKit/NSDocument/makeWindowControllers()), but not both. If [`windowNibName`](/documentation/AppKit/NSDocument/windowNibName) is overridden, the default implementation of [`makeWindowControllers()`](/documentation/AppKit/NSDocument/makeWindowControllers()) will load the named nib file, making the NSDocument the nib file’s owner. In that case, you can override [`windowControllerWillLoadNib(_:)`](/documentation/AppKit/NSDocument/windowControllerWillLoadNib(_:)) and do custom processing before the nib file is loaded.

The default implementation of this method does nothing.

---

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)