---
title: "windowTitle(forDocumentDisplayName:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nswindowcontroller/windowtitle(fordocumentdisplayname:)"
---

# windowTitle(forDocumentDisplayName:)

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

## Declaration

```swift
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

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.

## See Also

### Accessing Window Attributes and Content

- [shouldCascadeWindows](appkit/nswindowcontroller/shouldcascadewindows.md)
- [windowFrameAutosaveName](appkit/nswindowcontroller/windowframeautosavename.md)
- [synchronizeWindowTitleWithDocumentName()](appkit/nswindowcontroller/synchronizewindowtitlewithdocumentname().md)
- [contentViewController](appkit/nswindowcontroller/contentviewcontroller.md)
- [dismissController(_:)](appkit/nswindowcontroller/dismisscontroller(_:).md)
