---
title: "displayName(forType:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nsdocumentcontroller/displayname(fortype:)"
---

# displayName(forType:)

Returns the descriptive name for the specified document type, which is used in the File Format pop-up menu of the Save As dialog.

## Declaration

```swift
func displayName(forType typeName: String) -> String?
```

## Parameters

- `typeName`: The name of a document type, specified by CFBundleTypeName in the application’s Info.plist file.

## Return Value

Return Value The descriptive name for the document type specified by documentTypeName. If there is no descriptive name, returns documentTypeName.

## Discussion

Discussion For a document-based application, supported document types are specified in the Info.plist file by the CFBundleDocumentTypes array. Each document type is specified by a dictionary in this array, and is named by the CFBundleTypeName attribute. You can provide a descriptive, localized, representation of this name by providing a corresponding entry in the InfoPlist.strings file(s). For example, given an Info.plist file that contains the following fragment: <dict>     <key>CFBundleDocumentTypes</key>     <array>         <dict>             <key>CFBundleTypeName</key>             <string>BinaryFile</string>             <key>CFBundleTypeExtensions</key>             <array>                 <string>binary</string>             </array> you could provide a descriptive name by adding an entry in the InfoPlist.strings file: BinaryFile = "Binary file format";

## See Also

### Managing Document Types

- [documentClassNames](appkit/nsdocumentcontroller/documentclassnames.md)
- [defaultType](appkit/nsdocumentcontroller/defaulttype.md)
- [documentClass(forType:)](appkit/nsdocumentcontroller/documentclass(fortype:).md)
- [typeForContents(of:)](appkit/nsdocumentcontroller/typeforcontents(of:).md)
