---
title: "navigationItem(_:willBeginRenamingWith:selectedRange:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/uinavigationitemrenamedelegate-5j4ws/navigationitem(_:willbeginrenamingwith:selectedrange:)"
---

# navigationItem(_:willBeginRenamingWith:selectedRange:)

Tells the delegate when the rename process starts.

## Declaration

```swift
@MainActor @preconcurrency func navigationItem(_: UINavigationItem, willBeginRenamingWith suggestedTitle: String, selectedRange: Range<String.Index>) -> (String, Range<String.Index>)
```

## Parameters

- `_`: The navigation item with the changing title.
- `suggestedTitle`: The initial text to appear in the rename text field.
- `selectedRange`: The selected range of the initial text in the rename text field.

## Return Value

Return Value A string that contains the initial text that appears in the rename text field, and a range that determines which part of that text has selection.

## Discussion

Discussion UIKit calls this method when the rename process begins. Implement this method to customize the initial text and text selection that appears in the rename text field.

## See Also

### Handling the rename process

- [navigationItem(_:didEndRenamingWith:)](uikit/uinavigationitemrenamedelegate-5j4ws/navigationitem(_:didendrenamingwith:).md)
