Trait UITextFieldDelegate

Source
pub unsafe trait UITextFieldDelegate: NSObjectProtocol + MainThreadOnly {
    // Provided methods
    unsafe fn textFieldShouldBeginEditing(
        &self,
        text_field: &UITextField,
    ) -> bool
       where Self: Sized + Message { ... }
    unsafe fn textFieldDidBeginEditing(&self, text_field: &UITextField)
       where Self: Sized + Message { ... }
    unsafe fn textFieldShouldEndEditing(&self, text_field: &UITextField) -> bool
       where Self: Sized + Message { ... }
    unsafe fn textFieldDidEndEditing(&self, text_field: &UITextField)
       where Self: Sized + Message { ... }
    unsafe fn textFieldDidEndEditing_reason(
        &self,
        text_field: &UITextField,
        reason: UITextFieldDidEndEditingReason,
    )
       where Self: Sized + Message { ... }
    unsafe fn textField_shouldChangeCharactersInRange_replacementString(
        &self,
        text_field: &UITextField,
        range: NSRange,
        string: &NSString,
    ) -> bool
       where Self: Sized + Message { ... }
    unsafe fn textFieldDidChangeSelection(&self, text_field: &UITextField)
       where Self: Sized + Message { ... }
    unsafe fn textFieldShouldClear(&self, text_field: &UITextField) -> bool
       where Self: Sized + Message { ... }
    unsafe fn textFieldShouldReturn(&self, text_field: &UITextField) -> bool
       where Self: Sized + Message { ... }
    unsafe fn textField_editMenuForCharactersInRange_suggestedActions(
        &self,
        text_field: &UITextField,
        range: NSRange,
        suggested_actions: &NSArray<UIMenuElement>,
    ) -> Option<Retained<UIMenu>>
       where Self: Sized + Message { ... }
    unsafe fn textField_willPresentEditMenuWithAnimator(
        &self,
        text_field: &UITextField,
        animator: &ProtocolObject<dyn UIEditMenuInteractionAnimating>,
    )
       where Self: Sized + Message { ... }
    unsafe fn textField_willDismissEditMenuWithAnimator(
        &self,
        text_field: &UITextField,
        animator: &ProtocolObject<dyn UIEditMenuInteractionAnimating>,
    )
       where Self: Sized + Message { ... }
}
Available on crate feature UITextField only.
Expand description

Provided Methods§

Source

unsafe fn textFieldShouldBeginEditing(&self, text_field: &UITextField) -> bool
where Self: Sized + Message,

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

unsafe fn textFieldDidBeginEditing(&self, text_field: &UITextField)
where Self: Sized + Message,

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

unsafe fn textFieldShouldEndEditing(&self, text_field: &UITextField) -> bool
where Self: Sized + Message,

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

unsafe fn textFieldDidEndEditing(&self, text_field: &UITextField)
where Self: Sized + Message,

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

unsafe fn textFieldDidEndEditing_reason( &self, text_field: &UITextField, reason: UITextFieldDidEndEditingReason, )
where Self: Sized + Message,

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

unsafe fn textField_shouldChangeCharactersInRange_replacementString( &self, text_field: &UITextField, range: NSRange, string: &NSString, ) -> bool
where Self: Sized + Message,

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

unsafe fn textFieldDidChangeSelection(&self, text_field: &UITextField)
where Self: Sized + Message,

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

unsafe fn textFieldShouldClear(&self, text_field: &UITextField) -> bool
where Self: Sized + Message,

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

unsafe fn textFieldShouldReturn(&self, text_field: &UITextField) -> bool
where Self: Sized + Message,

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

unsafe fn textField_editMenuForCharactersInRange_suggestedActions( &self, text_field: &UITextField, range: NSRange, suggested_actions: &NSArray<UIMenuElement>, ) -> Option<Retained<UIMenu>>
where Self: Sized + Message,

Available on crate features UIControl and UIMenu and UIMenuElement and UIResponder and UIView only.

Asks the delegate for the menu to be shown for the specified text range.

Parameter textField: The text field requesting the menu.

Parameter range: The characters range for which the menu is presented for.

Parameter suggestedActions: The actions and commands that the system suggests.

Returns: Return a UIMenu describing the desired menu hierarchy. Return nilto present the default system menu.

Source

unsafe fn textField_willPresentEditMenuWithAnimator( &self, text_field: &UITextField, animator: &ProtocolObject<dyn UIEditMenuInteractionAnimating>, )
where Self: Sized + Message,

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

Called when the text field is about to present the edit menu.

Parameter textField: The text field displaying the menu.

Parameter animator: Appearance animator. Add animations to this object to run them alongside the appearance transition.

Source

unsafe fn textField_willDismissEditMenuWithAnimator( &self, text_field: &UITextField, animator: &ProtocolObject<dyn UIEditMenuInteractionAnimating>, )
where Self: Sized + Message,

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

Called when the text field is about to dismiss the edit menu.

Parameter textField: The text field displaying the menu.

Parameter animator: Dismissal animator. Add animations to this object to run them alongside the dismissal transition.

Trait Implementations§

Source§

impl ProtocolType for dyn UITextFieldDelegate

Source§

const NAME: &'static str = "UITextFieldDelegate"

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 UITextFieldDelegate

Implementations on Foreign Types§

Source§

impl<T> UITextFieldDelegate for ProtocolObject<T>

Implementors§