Trait UISearchTextFieldDelegate

Source
pub unsafe trait UISearchTextFieldDelegate: UITextFieldDelegate + MainThreadOnly {
    // Provided methods
    unsafe fn searchTextField_itemProviderForCopyingToken(
        &self,
        search_text_field: &UISearchTextField,
        token: &UISearchToken,
    ) -> Retained<NSItemProvider>
       where Self: Sized + Message { ... }
    unsafe fn searchTextField_didSelectSuggestion(
        &self,
        search_text_field: &UISearchTextField,
        suggestion: &ProtocolObject<dyn UISearchSuggestion>,
    )
       where Self: Sized + Message { ... }
}
Available on crate features UISearchTextField and UITextField only.
Expand description

Provided Methods§

Source

unsafe fn searchTextField_itemProviderForCopyingToken( &self, search_text_field: &UISearchTextField, token: &UISearchToken, ) -> Retained<NSItemProvider>
where Self: Sized + Message,

Available on crate features UIControl and UIResponder and UIView only.

Implements cut and copy of tokens.

To support drag and drop and the Cut and Copy commands, your delegate must implement this method and return an NSItemProvider for the requested token. The field’s textPasteDelegate is responsible for implementing pasting of tokens. Your delegate can provide a plain text representation for pasting in other contexts, but should register a custom type identifier so it can recognize and reconstruct the token when pasted into the same field.

This method will only be called if either of the field’s allowsCopyingTokens or allowsDeletingTokens properties is true.

Source

unsafe fn searchTextField_didSelectSuggestion( &self, search_text_field: &UISearchTextField, suggestion: &ProtocolObject<dyn UISearchSuggestion>, )
where Self: Sized + Message,

Available on crate features UIControl and UIResponder and UISearchSuggestion and UIView only.

searchSuggestions property will be set to nil after sending this message

Trait Implementations§

Source§

impl ProtocolType for dyn UISearchTextFieldDelegate

Source§

const NAME: &'static str = "UISearchTextFieldDelegate"

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 UISearchTextFieldDelegate

Implementations on Foreign Types§

Source§

impl<T> UISearchTextFieldDelegate for ProtocolObject<T>

Implementors§