UINavigationItemRenameDelegate

Trait UINavigationItemRenameDelegate 

Source
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 { ... }
}
Available on crate feature UINavigationItem only.
Expand description

Provided Methods§

Source

fn navigationItem_didEndRenamingWithTitle( &self, navigation_item: &UINavigationItem, title: &NSString, )
where Self: Sized + Message,

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.

Source

fn navigationItemShouldBeginRenaming( &self, navigation_item: &UINavigationItem, ) -> bool
where Self: Sized + Message,

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.

Source

unsafe fn navigationItem_willBeginRenamingWithSuggestedTitle_selectedRange( &self, navigation_item: &UINavigationItem, title: &NSString, selected_range: NonNull<NSRange>, ) -> Retained<NSString>
where Self: Sized + Message,

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.

Source

fn navigationItem_shouldEndRenamingWithTitle( &self, navigation_item: &UINavigationItem, title: &NSString, ) -> bool
where Self: Sized + Message,

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:.

Trait Implementations§

Source§

impl ProtocolType for dyn UINavigationItemRenameDelegate

Source§

const NAME: &'static str = "UINavigationItemRenameDelegate"

The name of the Objective-C protocol that this type represents. Read more
Source§

fn protocol() -> Option<&'static AnyProtocol>

Get a reference to the Objective-C protocol object that this type represents. Read more
Source§

impl<T> ImplementedBy<T> for dyn UINavigationItemRenameDelegate

Implementations on Foreign Types§

Source§

impl<T> UINavigationItemRenameDelegate for ProtocolObject<T>

Implementors§

Source§

impl UINavigationItemRenameDelegate for UIDocument

Available on crate feature UIDocument only.