pub unsafe trait UITextFieldDelegate: NSObjectProtocol + MainThreadOnly {
Show 15 methods
// Provided methods
fn textFieldShouldBeginEditing(&self, text_field: &UITextField) -> bool
where Self: Sized + Message { ... }
fn textFieldDidBeginEditing(&self, text_field: &UITextField)
where Self: Sized + Message { ... }
fn textFieldShouldEndEditing(&self, text_field: &UITextField) -> bool
where Self: Sized + Message { ... }
fn textFieldDidEndEditing(&self, text_field: &UITextField)
where Self: Sized + Message { ... }
fn textFieldDidEndEditing_reason(
&self,
text_field: &UITextField,
reason: UITextFieldDidEndEditingReason,
)
where Self: Sized + Message { ... }
fn textField_shouldChangeCharactersInRange_replacementString(
&self,
text_field: &UITextField,
range: NSRange,
string: &NSString,
) -> bool
where Self: Sized + Message { ... }
fn textField_shouldChangeCharactersInRanges_replacementString(
&self,
text_field: &UITextField,
ranges: &NSArray<NSValue>,
string: &NSString,
) -> bool
where Self: Sized + Message { ... }
fn textFieldDidChangeSelection(&self, text_field: &UITextField)
where Self: Sized + Message { ... }
fn textFieldShouldClear(&self, text_field: &UITextField) -> bool
where Self: Sized + Message { ... }
fn textFieldShouldReturn(&self, text_field: &UITextField) -> bool
where Self: Sized + Message { ... }
fn textField_editMenuForCharactersInRange_suggestedActions(
&self,
text_field: &UITextField,
range: NSRange,
suggested_actions: &NSArray<UIMenuElement>,
) -> Option<Retained<UIMenu>>
where Self: Sized + Message { ... }
fn textField_editMenuForCharactersInRanges_suggestedActions(
&self,
text_field: &UITextField,
ranges: &NSArray<NSValue>,
suggested_actions: &NSArray<UIMenuElement>,
) -> Option<Retained<UIMenu>>
where Self: Sized + Message { ... }
fn textField_willPresentEditMenuWithAnimator(
&self,
text_field: &UITextField,
animator: &ProtocolObject<dyn UIEditMenuInteractionAnimating>,
)
where Self: Sized + Message { ... }
fn textField_willDismissEditMenuWithAnimator(
&self,
text_field: &UITextField,
animator: &ProtocolObject<dyn UIEditMenuInteractionAnimating>,
)
where Self: Sized + Message { ... }
fn textField_insertInputSuggestion(
&self,
text_field: &UITextField,
input_suggestion: &UIInputSuggestion,
)
where Self: Sized + Message { ... }
}UITextField only.Expand description
Provided Methods§
fn textFieldShouldBeginEditing(&self, text_field: &UITextField) -> bool
UIControl and UIResponder and UIView only.fn textFieldDidBeginEditing(&self, text_field: &UITextField)
UIControl and UIResponder and UIView only.fn textFieldShouldEndEditing(&self, text_field: &UITextField) -> bool
UIControl and UIResponder and UIView only.fn textFieldDidEndEditing(&self, text_field: &UITextField)
UIControl and UIResponder and UIView only.fn textFieldDidEndEditing_reason( &self, text_field: &UITextField, reason: UITextFieldDidEndEditingReason, )
UIControl and UIResponder and UIView only.fn textField_shouldChangeCharactersInRange_replacementString( &self, text_field: &UITextField, range: NSRange, string: &NSString, ) -> bool
UIControl and UIResponder and UIView only.Sourcefn textField_shouldChangeCharactersInRanges_replacementString(
&self,
text_field: &UITextField,
ranges: &NSArray<NSValue>,
string: &NSString,
) -> bool
Available on crate features UIControl and UIResponder and UIView only.
fn textField_shouldChangeCharactersInRanges_replacementString( &self, text_field: &UITextField, ranges: &NSArray<NSValue>, string: &NSString, ) -> bool
UIControl and UIResponder and UIView only.Asks the delegate if the text at the specified ranges should be replaced with string.
If this method returns YES then the text field will, at its own discretion, choose any one of the specified ranges of text and replace it with the specified replacementString before deleting the text at the other ranges.
Parameter textField: The text field asking the delegate
Parameter ranges: The ranges of the text that should be deleted before replacing
Parameter replacementString: The replacement string
Returns: Returns YES if the text at the ranges should be replaced.
fn textFieldDidChangeSelection(&self, text_field: &UITextField)
UIControl and UIResponder and UIView only.fn textFieldShouldClear(&self, text_field: &UITextField) -> bool
UIControl and UIResponder and UIView only.fn textFieldShouldReturn(&self, text_field: &UITextField) -> bool
UIControl and UIResponder and UIView only.Sourcefn textField_editMenuForCharactersInRange_suggestedActions(
&self,
text_field: &UITextField,
range: NSRange,
suggested_actions: &NSArray<UIMenuElement>,
) -> Option<Retained<UIMenu>>
👎DeprecatedAvailable on crate features UIControl and UIMenu and UIMenuElement and UIResponder and UIView only.
fn textField_editMenuForCharactersInRange_suggestedActions( &self, text_field: &UITextField, range: NSRange, suggested_actions: &NSArray<UIMenuElement>, ) -> Option<Retained<UIMenu>>
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.
Sourcefn textField_editMenuForCharactersInRanges_suggestedActions(
&self,
text_field: &UITextField,
ranges: &NSArray<NSValue>,
suggested_actions: &NSArray<UIMenuElement>,
) -> Option<Retained<UIMenu>>
Available on crate features UIControl and UIMenu and UIMenuElement and UIResponder and UIView only.
fn textField_editMenuForCharactersInRanges_suggestedActions( &self, text_field: &UITextField, ranges: &NSArray<NSValue>, suggested_actions: &NSArray<UIMenuElement>, ) -> Option<Retained<UIMenu>>
UIControl and UIMenu and UIMenuElement and UIResponder and UIView only.Asks the delegate for the menu to be shown for the specified ranges.
Parameter textField: The text field requesting the menu.
Parameter ranges: The text ranges 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.
Sourcefn textField_willPresentEditMenuWithAnimator(
&self,
text_field: &UITextField,
animator: &ProtocolObject<dyn UIEditMenuInteractionAnimating>,
)
Available on crate features UIControl and UIEditMenuInteraction and UIResponder and UIView only.
fn textField_willPresentEditMenuWithAnimator( &self, text_field: &UITextField, animator: &ProtocolObject<dyn UIEditMenuInteractionAnimating>, )
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.
Sourcefn textField_willDismissEditMenuWithAnimator(
&self,
text_field: &UITextField,
animator: &ProtocolObject<dyn UIEditMenuInteractionAnimating>,
)
Available on crate features UIControl and UIEditMenuInteraction and UIResponder and UIView only.
fn textField_willDismissEditMenuWithAnimator( &self, text_field: &UITextField, animator: &ProtocolObject<dyn UIEditMenuInteractionAnimating>, )
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.
Sourcefn textField_insertInputSuggestion(
&self,
text_field: &UITextField,
input_suggestion: &UIInputSuggestion,
)
Available on crate features UIControl and UIInputSuggestion and UIResponder and UIView only.
fn textField_insertInputSuggestion( &self, text_field: &UITextField, input_suggestion: &UIInputSuggestion, )
UIControl and UIInputSuggestion and UIResponder and UIView only.Tells the delegate when the keyboard delivers an input suggestion.
- Parameters:
- textField: The text field that is currently the first responder.
- inputSuggestion: The input suggestion that the user or system selected.