---
title: "newDocument(_:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nsdocumentcontroller/newdocument(_:)"
---

# newDocument(_:)

An action method called by the New menu command, this method creates a new NSDocument object and adds it to the list of such objects managed by the document controller.

## Declaration

```swift
@IBAction func newDocument(_ sender: Any?)
```

## Discussion

Discussion This method calls openUntitledDocumentAndDisplay(_:).

## See Also

### Responding to Action Messages

- [openDocument(_:)](appkit/nsdocumentcontroller/opendocument(_:).md)
- [saveAllDocuments(_:)](appkit/nsdocumentcontroller/savealldocuments(_:).md)
