pub unsafe trait UINavigationItemRenameDelegate: NSObjectProtocol + MainThreadOnly {
// Provided methods
fn navigationItem_didEndRenamingWithTitle(
&self,
navigation_item: &UINavigationItem,
title: &NSString,
)
where Self: Sized + Message { ... }
fn navigationItemShouldBeginRenaming(
&self,
navigation_item: &UINavigationItem,
) -> bool
where Self: Sized + Message { ... }
unsafe fn navigationItem_willBeginRenamingWithSuggestedTitle_selectedRange(
&self,
navigation_item: &UINavigationItem,
title: &NSString,
selected_range: NonNull<NSRange>,
) -> Retained<NSString>
where Self: Sized + Message { ... }
fn navigationItem_shouldEndRenamingWithTitle(
&self,
navigation_item: &UINavigationItem,
title: &NSString,
) -> bool
where Self: Sized + Message { ... }
}UINavigationItem only.Expand description
Provided Methods§
This method is called when renaming has ended. The title on the navigation item has already been changed when this method is called but clients can make further adjustments to it when necessary.
Controls whether the rename action is supported for the given navigation item. For example this method is called when the navigation bar’s document menu is shown to validate if the rename action should be part of that menu.
Called when we begin renaming. Implementing this method allows for customizing the initial text that will show up in the text field as well as the selected range of that text.
§Safety
selected_range must be a valid pointer.
This method can be used to prevent renaming from happening. However there are cases (e.g. when a new navigation item is pushed on the navigation bar) where this method will not be called and instead navigationItem:didEndRenamingWithTitle: is called right away. Clients are therefore expected to handle titles in navigationItem:didEndRenamingWithTitle: for which they would return NO from navigationItem:shouldEndRenamingWithTitle:.