UISearchBarDelegate

Trait UISearchBarDelegate 

Source
pub unsafe trait UISearchBarDelegate: UIBarPositioningDelegate + MainThreadOnly {
    // Provided methods
    fn searchBarShouldBeginEditing(&self, search_bar: &UISearchBar) -> bool
       where Self: Sized + Message { ... }
    fn searchBarTextDidBeginEditing(&self, search_bar: &UISearchBar)
       where Self: Sized + Message { ... }
    fn searchBarShouldEndEditing(&self, search_bar: &UISearchBar) -> bool
       where Self: Sized + Message { ... }
    fn searchBarTextDidEndEditing(&self, search_bar: &UISearchBar)
       where Self: Sized + Message { ... }
    fn searchBar_textDidChange(
        &self,
        search_bar: &UISearchBar,
        search_text: &NSString,
    )
       where Self: Sized + Message { ... }
    fn searchBar_shouldChangeTextInRange_replacementText(
        &self,
        search_bar: &UISearchBar,
        range: NSRange,
        text: &NSString,
    ) -> bool
       where Self: Sized + Message { ... }
    fn searchBar_shouldChangeTextInRanges_replacementText(
        &self,
        search_bar: &UISearchBar,
        ranges: &NSArray<NSValue>,
        replacement_text: &NSString,
    ) -> bool
       where Self: Sized + Message { ... }
    fn searchBarSearchButtonClicked(&self, search_bar: &UISearchBar)
       where Self: Sized + Message { ... }
    fn searchBarBookmarkButtonClicked(&self, search_bar: &UISearchBar)
       where Self: Sized + Message { ... }
    fn searchBarCancelButtonClicked(&self, search_bar: &UISearchBar)
       where Self: Sized + Message { ... }
    fn searchBarResultsListButtonClicked(&self, search_bar: &UISearchBar)
       where Self: Sized + Message { ... }
    fn searchBar_selectedScopeButtonIndexDidChange(
        &self,
        search_bar: &UISearchBar,
        selected_scope: NSInteger,
    )
       where Self: Sized + Message { ... }
}
Available on crate features UIBarCommon and UISearchBar only.
Expand description

Provided Methods§

Source

fn searchBarShouldBeginEditing(&self, search_bar: &UISearchBar) -> bool
where Self: Sized + Message,

Available on crate features UIResponder and UIView only.
Source

fn searchBarTextDidBeginEditing(&self, search_bar: &UISearchBar)
where Self: Sized + Message,

Available on crate features UIResponder and UIView only.
Source

fn searchBarShouldEndEditing(&self, search_bar: &UISearchBar) -> bool
where Self: Sized + Message,

Available on crate features UIResponder and UIView only.
Source

fn searchBarTextDidEndEditing(&self, search_bar: &UISearchBar)
where Self: Sized + Message,

Available on crate features UIResponder and UIView only.
Source

fn searchBar_textDidChange( &self, search_bar: &UISearchBar, search_text: &NSString, )
where Self: Sized + Message,

Available on crate features UIResponder and UIView only.
Source

fn searchBar_shouldChangeTextInRange_replacementText( &self, search_bar: &UISearchBar, range: NSRange, text: &NSString, ) -> bool
where Self: Sized + Message,

👎Deprecated
Available on crate features UIResponder and UIView only.
Source

fn searchBar_shouldChangeTextInRanges_replacementText( &self, search_bar: &UISearchBar, ranges: &NSArray<NSValue>, replacement_text: &NSString, ) -> bool
where Self: Sized + Message,

Available on crate features UIResponder and UIView only.

Asks the delegate if the text at the specified ranges should be replaced with text.

If this method returns YES then the search bar will, at its own discretion, choose any one of the specified ranges of text and replace it with the specified replacementText before deleting the text at the other ranges. If the delegate does not implement this method then the searchBar:shouldChangeTextInRange:replacementText: method will be called and passed the union range instead. If the delegate also does not implement that method then YES is assumed.

Parameter searchBar: The search bar asking the delegate

Parameter ranges: The ranges of the text that should be deleted before replacing

Parameter replacementText: The replacement text

Returns: Returns true if the text at the ranges should be replaced.

Source

fn searchBarSearchButtonClicked(&self, search_bar: &UISearchBar)
where Self: Sized + Message,

Available on crate features UIResponder and UIView only.
Source

fn searchBarBookmarkButtonClicked(&self, search_bar: &UISearchBar)
where Self: Sized + Message,

Available on crate features UIResponder and UIView only.
Source

fn searchBarCancelButtonClicked(&self, search_bar: &UISearchBar)
where Self: Sized + Message,

Available on crate features UIResponder and UIView only.
Source

fn searchBarResultsListButtonClicked(&self, search_bar: &UISearchBar)
where Self: Sized + Message,

Available on crate features UIResponder and UIView only.
Source

fn searchBar_selectedScopeButtonIndexDidChange( &self, search_bar: &UISearchBar, selected_scope: NSInteger, )
where Self: Sized + Message,

Available on crate features UIResponder and UIView only.

Trait Implementations§

Source§

impl ProtocolType for dyn UISearchBarDelegate

Source§

const NAME: &'static str = "UISearchBarDelegate"

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 UISearchBarDelegate

Implementations on Foreign Types§

Source§

impl<T> UISearchBarDelegate for ProtocolObject<T>

Implementors§