---
title: "rename(_:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nsdocument/rename(_:)"
---

# rename(_:)

Renames the current document in response to the user choosing the Rename menu item.

## Declaration

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

## Parameters

- `sender`: The control sending the message.

## Discussion

Discussion This is the action method of the Rename menu item in a document-based app. The default implementation of this method initiates a renaming session in a window created by the [self windowForSheet] message.
