---
title: defaultDraftName()
framework: appkit
role: symbol
role_heading: Instance Method
path: appkit/nsdocument/defaultdraftname()
---

# defaultDraftName()

Returns the default draft name for the document subclass.

## Declaration

```swift
func defaultDraftName() -> String
```

## Discussion

Discussion The default implementation of this method returns the string “Untitled”, as adjusted according to the user’s specified locale. Your app should typically return a name that describes the kind of document. For example, a spreadsheet app could return “Spreadsheet”. A document created from a template could return the name of the template, for example, “Résumé”. When a document has not yet been assigned a name, and has not yet been autosaved with the NSDocument.SaveOperationType.autosaveAsOperation save operation type, the document bases the default name on the value in the displayName property. If there is a already another document or file in the same place and with the same name as would be returned by this method, NSDocument appends a number to the defaultDraftName() string.

## See Also

### Managing Document Windows

- [showWindows()](appkit/nsdocument/showwindows().md)
- [setWindow(_:)](appkit/nsdocument/setwindow(_:).md)
- [windowForSheet](appkit/nsdocument/windowforsheet.md)
- [displayName](appkit/nsdocument/displayname.md)
- [encodeRestorableState(with:backgroundQueue:)](appkit/nsdocument/encoderestorablestate(with:backgroundqueue:).md)
