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

# windowTitle(forDocumentDisplayName:)

Returns the window title to be used for a given document display name.

```
func windowTitle(forDocumentDisplayName displayName: String) -> String
```

## Parameters

`displayName`

The display name for the document. This is the last path component under which the document file is saved.

## Discussion

The default implementation returns `displayName`. Subclasses can override this method to customize the window title. For example, a CAD application could append “-Top” or “-Side,” depending on the view displayed by the window.

---

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)