<!--
{
  "availability" : [
    "iOS: 16.0.0 -",
    "iPadOS: 16.0.0 -",
    "macCatalyst: -",
    "visionOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UINavigationItemRenameDelegate-5j4ws/navigationItem(_:willBeginRenamingWith:selectedRange:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "s:5UIKit30UINavigationItemRenameDelegateP010navigationC0_21willBeginRenamingWith13selectedRangeSS_SnySS5IndexVGtSo0bC0C_SSAItF"
  },
  "title" : "navigationItem(_:willBeginRenamingWith:selectedRange:)"
}
-->

# navigationItem(_:willBeginRenamingWith:selectedRange:)

Tells the delegate when the rename process starts.

```
@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

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

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.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)