---
title: "navigationItem(_:shouldEndRenamingWith:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/uinavigationitemrenamedelegate-5j4ws/navigationitem(_:shouldendrenamingwith:)"
---

# navigationItem(_:shouldEndRenamingWith:)

Asks the delegate whether to continue or abandon the rename process.

## Declaration

```swift
@MainActor @preconcurrency func navigationItem(_: UINavigationItem, shouldEndRenamingWith title: String) -> Bool
```

## Parameters

- `_`: The navigation item attempting to continue the rename process.
- `title`: The new title of the navigation item.

## Return Value

Return Value true to continue the rename process; false to cancel the rename process.

## Discussion

Discussion Implement this method to return false to prevent renaming. important: UIKit might not call this method in certain situations, like when the system pushes a new navigation item onto the navigation bar. In these situations, UIKit calls navigationItem(_:didEndRenamingWith:) instead. Therefore, make sure to implement navigationItem(_:didEndRenamingWith:) to handle the cases when navigationItem(_:shouldEndRenamingWith:) returns false.

## See Also

### Determining rename support

- [navigationItemShouldBeginRenaming(_:)](uikit/uinavigationitemrenamedelegate-5j4ws/navigationitemshouldbeginrenaming(_:).md)
