pub unsafe trait UITextViewDelegate:
NSObjectProtocol
+ UIScrollViewDelegate
+ MainThreadOnly {
Show 28 methods
// Provided methods
fn textViewShouldBeginEditing(&self, text_view: &UITextView) -> bool
where Self: Sized + Message { ... }
fn textViewShouldEndEditing(&self, text_view: &UITextView) -> bool
where Self: Sized + Message { ... }
fn textViewDidBeginEditing(&self, text_view: &UITextView)
where Self: Sized + Message { ... }
fn textViewDidEndEditing(&self, text_view: &UITextView)
where Self: Sized + Message { ... }
fn textView_shouldChangeTextInRange_replacementText(
&self,
text_view: &UITextView,
range: NSRange,
text: &NSString,
) -> bool
where Self: Sized + Message { ... }
fn textView_shouldChangeTextInRanges_replacementText(
&self,
text_view: &UITextView,
ranges: &NSArray<NSValue>,
text: &NSString,
) -> bool
where Self: Sized + Message { ... }
fn textViewDidChange(&self, text_view: &UITextView)
where Self: Sized + Message { ... }
fn textViewDidChangeSelection(&self, text_view: &UITextView)
where Self: Sized + Message { ... }
fn textView_editMenuForTextInRange_suggestedActions(
&self,
text_view: &UITextView,
range: NSRange,
suggested_actions: &NSArray<UIMenuElement>,
) -> Option<Retained<UIMenu>>
where Self: Sized + Message { ... }
fn textView_editMenuForTextInRanges_suggestedActions(
&self,
text_view: &UITextView,
ranges: &NSArray<NSValue>,
suggested_actions: &NSArray<UIMenuElement>,
) -> Option<Retained<UIMenu>>
where Self: Sized + Message { ... }
fn textView_willPresentEditMenuWithAnimator(
&self,
text_view: &UITextView,
animator: &ProtocolObject<dyn UIEditMenuInteractionAnimating>,
)
where Self: Sized + Message { ... }
fn textView_willDismissEditMenuWithAnimator(
&self,
text_view: &UITextView,
animator: &ProtocolObject<dyn UIEditMenuInteractionAnimating>,
)
where Self: Sized + Message { ... }
fn textView_primaryActionForTextItem_defaultAction(
&self,
text_view: &UITextView,
text_item: &UITextItem,
default_action: &UIAction,
) -> Option<Retained<UIAction>>
where Self: Sized + Message { ... }
fn textView_menuConfigurationForTextItem_defaultMenu(
&self,
text_view: &UITextView,
text_item: &UITextItem,
default_menu: &UIMenu,
) -> Option<Retained<UITextItemMenuConfiguration>>
where Self: Sized + Message { ... }
fn textView_textItemMenuWillDisplayForTextItem_animator(
&self,
text_view: &UITextView,
text_item: &UITextItem,
animator: &ProtocolObject<dyn UIContextMenuInteractionAnimating>,
)
where Self: Sized + Message { ... }
fn textView_textItemMenuWillEndForTextItem_animator(
&self,
text_view: &UITextView,
text_item: &UITextItem,
animator: &ProtocolObject<dyn UIContextMenuInteractionAnimating>,
)
where Self: Sized + Message { ... }
fn textViewWritingToolsWillBegin(&self, text_view: &UITextView)
where Self: Sized + Message { ... }
fn textViewWritingToolsDidEnd(&self, text_view: &UITextView)
where Self: Sized + Message { ... }
fn textView_writingToolsIgnoredRangesInEnclosingRange(
&self,
text_view: &UITextView,
enclosing_range: NSRange,
) -> Retained<NSArray<NSValue>>
where Self: Sized + Message { ... }
fn textView_shouldInteractWithURL_inRange_interaction(
&self,
text_view: &UITextView,
url: &NSURL,
character_range: NSRange,
interaction: UITextItemInteraction,
) -> bool
where Self: Sized + Message { ... }
fn textView_shouldInteractWithTextAttachment_inRange_interaction(
&self,
text_view: &UITextView,
text_attachment: &NSTextAttachment,
character_range: NSRange,
interaction: UITextItemInteraction,
) -> bool
where Self: Sized + Message { ... }
fn textView_shouldInteractWithURL_inRange(
&self,
text_view: &UITextView,
url: &NSURL,
character_range: NSRange,
) -> bool
where Self: Sized + Message { ... }
fn textView_shouldInteractWithTextAttachment_inRange(
&self,
text_view: &UITextView,
text_attachment: &NSTextAttachment,
character_range: NSRange,
) -> bool
where Self: Sized + Message { ... }
fn textView_willBeginFormattingWithViewController(
&self,
text_view: &UITextView,
view_controller: &UITextFormattingViewController,
)
where Self: Sized + Message { ... }
fn textView_didBeginFormattingWithViewController(
&self,
text_view: &UITextView,
view_controller: &UITextFormattingViewController,
)
where Self: Sized + Message { ... }
fn textView_willEndFormattingWithViewController(
&self,
text_view: &UITextView,
view_controller: &UITextFormattingViewController,
)
where Self: Sized + Message { ... }
fn textView_didEndFormattingWithViewController(
&self,
text_view: &UITextView,
view_controller: &UITextFormattingViewController,
)
where Self: Sized + Message { ... }
fn textView_insertInputSuggestion(
&self,
text_view: &UITextView,
input_suggestion: &UIInputSuggestion,
)
where Self: Sized + Message { ... }
}UIScrollView and UITextView only.Expand description
Provided Methods§
fn textViewShouldBeginEditing(&self, text_view: &UITextView) -> bool
UIResponder and UIView only.fn textViewShouldEndEditing(&self, text_view: &UITextView) -> bool
UIResponder and UIView only.fn textViewDidBeginEditing(&self, text_view: &UITextView)
UIResponder and UIView only.fn textViewDidEndEditing(&self, text_view: &UITextView)
UIResponder and UIView only.fn textView_shouldChangeTextInRange_replacementText( &self, text_view: &UITextView, range: NSRange, text: &NSString, ) -> bool
UIResponder and UIView only.Sourcefn textView_shouldChangeTextInRanges_replacementText(
&self,
text_view: &UITextView,
ranges: &NSArray<NSValue>,
text: &NSString,
) -> bool
Available on crate features UIResponder and UIView only.
fn textView_shouldChangeTextInRanges_replacementText( &self, text_view: &UITextView, ranges: &NSArray<NSValue>, text: &NSString, ) -> bool
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 text view 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 textView: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 textView: The text view 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.
fn textViewDidChange(&self, text_view: &UITextView)
UIResponder and UIView only.fn textViewDidChangeSelection(&self, text_view: &UITextView)
UIResponder and UIView only.Sourcefn textView_editMenuForTextInRange_suggestedActions(
&self,
text_view: &UITextView,
range: NSRange,
suggested_actions: &NSArray<UIMenuElement>,
) -> Option<Retained<UIMenu>>
👎DeprecatedAvailable on crate features UIMenu and UIMenuElement and UIResponder and UIView only.
fn textView_editMenuForTextInRange_suggestedActions( &self, text_view: &UITextView, range: NSRange, suggested_actions: &NSArray<UIMenuElement>, ) -> Option<Retained<UIMenu>>
UIMenu and UIMenuElement and UIResponder and UIView only.Asks the delegate for the menu to be shown for the specified text range.
Parameter textView: The text view requesting the menu.
Parameter range: The text 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 textView_editMenuForTextInRanges_suggestedActions(
&self,
text_view: &UITextView,
ranges: &NSArray<NSValue>,
suggested_actions: &NSArray<UIMenuElement>,
) -> Option<Retained<UIMenu>>
Available on crate features UIMenu and UIMenuElement and UIResponder and UIView only.
fn textView_editMenuForTextInRanges_suggestedActions( &self, text_view: &UITextView, ranges: &NSArray<NSValue>, suggested_actions: &NSArray<UIMenuElement>, ) -> Option<Retained<UIMenu>>
UIMenu and UIMenuElement and UIResponder and UIView only.Asks the delegate for the menu to be shown for the specified text ranges.
If the delegate does not implement this method then the textView:editMenuForTextInRange:suggestedActions: method will be called and passed the union range instead. If the delegate also does not implement that method then nil is assumed.
Parameter textView: The text view 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 textView_willPresentEditMenuWithAnimator(
&self,
text_view: &UITextView,
animator: &ProtocolObject<dyn UIEditMenuInteractionAnimating>,
)
Available on crate features UIEditMenuInteraction and UIResponder and UIView only.
fn textView_willPresentEditMenuWithAnimator( &self, text_view: &UITextView, animator: &ProtocolObject<dyn UIEditMenuInteractionAnimating>, )
UIEditMenuInteraction and UIResponder and UIView only.Called when the text view is about to present the edit menu.
Parameter textView: The text view displaying the menu.
Parameter animator: Appearance animator. Add animations to this object to run them alongside the appearance transition.
Sourcefn textView_willDismissEditMenuWithAnimator(
&self,
text_view: &UITextView,
animator: &ProtocolObject<dyn UIEditMenuInteractionAnimating>,
)
Available on crate features UIEditMenuInteraction and UIResponder and UIView only.
fn textView_willDismissEditMenuWithAnimator( &self, text_view: &UITextView, animator: &ProtocolObject<dyn UIEditMenuInteractionAnimating>, )
UIEditMenuInteraction and UIResponder and UIView only.Called when the text view is about to dismiss the edit menu.
Parameter textView: The text view displaying the menu.
Parameter animator: Dismissal animator. Add animations to this object to run them alongside the dismissal transition.
Sourcefn textView_primaryActionForTextItem_defaultAction(
&self,
text_view: &UITextView,
text_item: &UITextItem,
default_action: &UIAction,
) -> Option<Retained<UIAction>>
Available on crate features UIAction and UIMenuElement and UIResponder and UITextItem and UIView only.
fn textView_primaryActionForTextItem_defaultAction( &self, text_view: &UITextView, text_item: &UITextItem, default_action: &UIAction, ) -> Option<Retained<UIAction>>
UIAction and UIMenuElement and UIResponder and UITextItem and UIView only.Asks the delegate for the action to be performed when interacting with a text item. If a nil action is provided, the text view will request a menu to be presented on primary action if possible.
Parameter textView: The text view requesting the primary action.
Parameter textItem: The text item for performing said action.
Parameter defaultAction: The default action for the text item. Return this to perform the default action.
Returns: Return a UIAction to be performed when the text item is interacted with. Return
nilto prevent the action from being performed.
Available on crate features UIMenu and UIMenuElement and UIResponder and UITextItem and UIView only.
UIMenu and UIMenuElement and UIResponder and UITextItem and UIView only.Asks the delegate for the menu configuration to be performed when interacting with a text item.
Parameter textView: The text view requesting the menu.
Parameter textItem: The text item for performing said action.
Parameter defaultMenu: The default menu for the specified text item.
Returns: Return a menu configuration to be presented when the text item is interacted with. Return
nilto prevent the menu from being presented.
Sourcefn textView_textItemMenuWillDisplayForTextItem_animator(
&self,
text_view: &UITextView,
text_item: &UITextItem,
animator: &ProtocolObject<dyn UIContextMenuInteractionAnimating>,
)
Available on crate features UIContextMenuInteraction and UIResponder and UITextItem and UIView only.
fn textView_textItemMenuWillDisplayForTextItem_animator( &self, text_view: &UITextView, text_item: &UITextItem, animator: &ProtocolObject<dyn UIContextMenuInteractionAnimating>, )
UIContextMenuInteraction and UIResponder and UITextItem and UIView only.Informs the delegate that a text item menu is about to be presented with the specified animator.
Parameter textView: The text view showing the menu.
Parameter textItem: The text item for performing said action.
Parameter animator: Appearance animator. Add animations to this object to run them alongside the appearance transition.
Sourcefn textView_textItemMenuWillEndForTextItem_animator(
&self,
text_view: &UITextView,
text_item: &UITextItem,
animator: &ProtocolObject<dyn UIContextMenuInteractionAnimating>,
)
Available on crate features UIContextMenuInteraction and UIResponder and UITextItem and UIView only.
fn textView_textItemMenuWillEndForTextItem_animator( &self, text_view: &UITextView, text_item: &UITextItem, animator: &ProtocolObject<dyn UIContextMenuInteractionAnimating>, )
UIContextMenuInteraction and UIResponder and UITextItem and UIView only.Informs the delegate that a text item menu is about to be dismissed with the specified animator.
Parameter textView: The text view showing the menu.
Parameter textItem: The text item for performing said action.
Parameter animator: Dismissal animator. Add animations to this object to run them alongside the dismissal transition.
Sourcefn textViewWritingToolsWillBegin(&self, text_view: &UITextView)
Available on crate features UIResponder and UIView only.
fn textViewWritingToolsWillBegin(&self, text_view: &UITextView)
UIResponder and UIView only.Informs the delegate that Writing Tools will begin manipulating the text view
Parameter textView: The text view interacting with Writing Tools
Sourcefn textViewWritingToolsDidEnd(&self, text_view: &UITextView)
Available on crate features UIResponder and UIView only.
fn textViewWritingToolsDidEnd(&self, text_view: &UITextView)
UIResponder and UIView only.Informs the delegate that Writing Tools has finished manipulating the text view
Parameter textView: The text view interacting with Writing Tools
Sourcefn textView_writingToolsIgnoredRangesInEnclosingRange(
&self,
text_view: &UITextView,
enclosing_range: NSRange,
) -> Retained<NSArray<NSValue>>
Available on crate features UIResponder and UIView only.
fn textView_writingToolsIgnoredRangesInEnclosingRange( &self, text_view: &UITextView, enclosing_range: NSRange, ) -> Retained<NSArray<NSValue>>
UIResponder and UIView only.Allows the delegate to specify ranges of text to be ignored by Writing Tools
Parameter textView: The text view interacting with Writing Tools
Parameter enclosingRange:
Returns: Return an array of ranges in the attributed substring of the textView storage with the enclosing range representing portions of text to be ignored by Writing Tools when evaluating the text for proofreading, summarization, rewrites, and so forth.
fn textView_shouldInteractWithURL_inRange_interaction( &self, text_view: &UITextView, url: &NSURL, character_range: NSRange, interaction: UITextItemInteraction, ) -> bool
UIResponder and UITextItemInteraction and UIView only.fn textView_shouldInteractWithTextAttachment_inRange_interaction( &self, text_view: &UITextView, text_attachment: &NSTextAttachment, character_range: NSRange, interaction: UITextItemInteraction, ) -> bool
NSTextAttachment and UIResponder and UITextItemInteraction and UIView only.fn textView_shouldInteractWithURL_inRange( &self, text_view: &UITextView, url: &NSURL, character_range: NSRange, ) -> bool
UIResponder and UIView only.fn textView_shouldInteractWithTextAttachment_inRange( &self, text_view: &UITextView, text_attachment: &NSTextAttachment, character_range: NSRange, ) -> bool
NSTextAttachment and UIResponder and UIView only.Sourcefn textView_willBeginFormattingWithViewController(
&self,
text_view: &UITextView,
view_controller: &UITextFormattingViewController,
)
Available on crate features UIResponder and UITextFormattingViewController and UIView and UIViewController only.
fn textView_willBeginFormattingWithViewController( &self, text_view: &UITextView, view_controller: &UITextFormattingViewController, )
UIResponder and UITextFormattingViewController and UIView and UIViewController only.Informs the delegate that text formatting controller is about to be presented.
Parameter viewController: The text formatting controller that is being presented.
Sourcefn textView_didBeginFormattingWithViewController(
&self,
text_view: &UITextView,
view_controller: &UITextFormattingViewController,
)
Available on crate features UIResponder and UITextFormattingViewController and UIView and UIViewController only.
fn textView_didBeginFormattingWithViewController( &self, text_view: &UITextView, view_controller: &UITextFormattingViewController, )
UIResponder and UITextFormattingViewController and UIView and UIViewController only.Informs the delegate that text formatting controller has been presented.
Parameter viewController: The text formatting controller that is being presented.
Sourcefn textView_willEndFormattingWithViewController(
&self,
text_view: &UITextView,
view_controller: &UITextFormattingViewController,
)
Available on crate features UIResponder and UITextFormattingViewController and UIView and UIViewController only.
fn textView_willEndFormattingWithViewController( &self, text_view: &UITextView, view_controller: &UITextFormattingViewController, )
UIResponder and UITextFormattingViewController and UIView and UIViewController only.Informs the delegate that text formatting controller is about to be dismissed.
Parameter viewController: The text formatting controller that is being presented.
Sourcefn textView_didEndFormattingWithViewController(
&self,
text_view: &UITextView,
view_controller: &UITextFormattingViewController,
)
Available on crate features UIResponder and UITextFormattingViewController and UIView and UIViewController only.
fn textView_didEndFormattingWithViewController( &self, text_view: &UITextView, view_controller: &UITextFormattingViewController, )
UIResponder and UITextFormattingViewController and UIView and UIViewController only.Informs the delegate that text formatting controller has been dismissed.
Parameter viewController: The text formatting controller that is being presented.
Sourcefn textView_insertInputSuggestion(
&self,
text_view: &UITextView,
input_suggestion: &UIInputSuggestion,
)
Available on crate features UIInputSuggestion and UIResponder and UIView only.
fn textView_insertInputSuggestion( &self, text_view: &UITextView, input_suggestion: &UIInputSuggestion, )
UIInputSuggestion and UIResponder and UIView only.Tells the delegate when the keyboard delivers an input suggestion.
- Parameters:
- textView: The text view that is currently the first responder.
- inputSuggestion: The input suggestion that the user or system selected.