Trait UITextViewDelegate

Source
pub unsafe trait UITextViewDelegate:
    NSObjectProtocol
    + UIScrollViewDelegate
    + MainThreadOnly {
Show 26 methods // Provided methods unsafe fn textViewShouldBeginEditing(&self, text_view: &UITextView) -> bool where Self: Sized + Message { ... } unsafe fn textViewShouldEndEditing(&self, text_view: &UITextView) -> bool where Self: Sized + Message { ... } unsafe fn textViewDidBeginEditing(&self, text_view: &UITextView) where Self: Sized + Message { ... } unsafe fn textViewDidEndEditing(&self, text_view: &UITextView) where Self: Sized + Message { ... } unsafe fn textView_shouldChangeTextInRange_replacementText( &self, text_view: &UITextView, range: NSRange, text: &NSString, ) -> bool where Self: Sized + Message { ... } unsafe fn textViewDidChange(&self, text_view: &UITextView) where Self: Sized + Message { ... } unsafe fn textViewDidChangeSelection(&self, text_view: &UITextView) where Self: Sized + Message { ... } unsafe fn textView_editMenuForTextInRange_suggestedActions( &self, text_view: &UITextView, range: NSRange, suggested_actions: &NSArray<UIMenuElement>, ) -> Option<Retained<UIMenu>> where Self: Sized + Message { ... } unsafe fn textView_willPresentEditMenuWithAnimator( &self, text_view: &UITextView, animator: &ProtocolObject<dyn UIEditMenuInteractionAnimating>, ) where Self: Sized + Message { ... } unsafe fn textView_willDismissEditMenuWithAnimator( &self, text_view: &UITextView, animator: &ProtocolObject<dyn UIEditMenuInteractionAnimating>, ) where Self: Sized + Message { ... } unsafe fn textView_primaryActionForTextItem_defaultAction( &self, text_view: &UITextView, text_item: &UITextItem, default_action: &UIAction, ) -> Option<Retained<UIAction>> where Self: Sized + Message { ... } unsafe fn textView_menuConfigurationForTextItem_defaultMenu( &self, text_view: &UITextView, text_item: &UITextItem, default_menu: &UIMenu, ) -> Option<Retained<UITextItemMenuConfiguration>> where Self: Sized + Message { ... } unsafe fn textView_textItemMenuWillDisplayForTextItem_animator( &self, text_view: &UITextView, text_item: &UITextItem, animator: &ProtocolObject<dyn UIContextMenuInteractionAnimating>, ) where Self: Sized + Message { ... } unsafe fn textView_textItemMenuWillEndForTextItem_animator( &self, text_view: &UITextView, text_item: &UITextItem, animator: &ProtocolObject<dyn UIContextMenuInteractionAnimating>, ) where Self: Sized + Message { ... } unsafe fn textViewWritingToolsWillBegin(&self, text_view: &UITextView) where Self: Sized + Message { ... } unsafe fn textViewWritingToolsDidEnd(&self, text_view: &UITextView) where Self: Sized + Message { ... } unsafe fn textView_writingToolsIgnoredRangesInEnclosingRange( &self, text_view: &UITextView, enclosing_range: NSRange, ) -> Retained<NSArray<NSValue>> where Self: Sized + Message { ... } unsafe fn textView_shouldInteractWithURL_inRange_interaction( &self, text_view: &UITextView, url: &NSURL, character_range: NSRange, interaction: UITextItemInteraction, ) -> bool where Self: Sized + Message { ... } unsafe fn textView_shouldInteractWithTextAttachment_inRange_interaction( &self, text_view: &UITextView, text_attachment: &NSTextAttachment, character_range: NSRange, interaction: UITextItemInteraction, ) -> bool where Self: Sized + Message { ... } unsafe fn textView_shouldInteractWithURL_inRange( &self, text_view: &UITextView, url: &NSURL, character_range: NSRange, ) -> bool where Self: Sized + Message { ... } unsafe fn textView_shouldInteractWithTextAttachment_inRange( &self, text_view: &UITextView, text_attachment: &NSTextAttachment, character_range: NSRange, ) -> bool where Self: Sized + Message { ... } unsafe fn textView_willBeginFormattingWithViewController( &self, text_view: &UITextView, view_controller: &UITextFormattingViewController, ) where Self: Sized + Message { ... } unsafe fn textView_didBeginFormattingWithViewController( &self, text_view: &UITextView, view_controller: &UITextFormattingViewController, ) where Self: Sized + Message { ... } unsafe fn textView_willEndFormattingWithViewController( &self, text_view: &UITextView, view_controller: &UITextFormattingViewController, ) where Self: Sized + Message { ... } unsafe fn textView_didEndFormattingWithViewController( &self, text_view: &UITextView, view_controller: &UITextFormattingViewController, ) where Self: Sized + Message { ... } unsafe fn textView_insertInputSuggestion( &self, text_view: &UITextView, input_suggestion: &UIInputSuggestion, ) where Self: Sized + Message { ... }
}
Available on crate features UIScrollView and UITextView only.
Expand description

Provided Methods§

Source

unsafe fn textViewShouldBeginEditing(&self, text_view: &UITextView) -> bool
where Self: Sized + Message,

Available on crate features UIResponder and UIView only.
Source

unsafe fn textViewShouldEndEditing(&self, text_view: &UITextView) -> bool
where Self: Sized + Message,

Available on crate features UIResponder and UIView only.
Source

unsafe fn textViewDidBeginEditing(&self, text_view: &UITextView)
where Self: Sized + Message,

Available on crate features UIResponder and UIView only.
Source

unsafe fn textViewDidEndEditing(&self, text_view: &UITextView)
where Self: Sized + Message,

Available on crate features UIResponder and UIView only.
Source

unsafe fn textView_shouldChangeTextInRange_replacementText( &self, text_view: &UITextView, range: NSRange, text: &NSString, ) -> bool
where Self: Sized + Message,

Available on crate features UIResponder and UIView only.
Source

unsafe fn textViewDidChange(&self, text_view: &UITextView)
where Self: Sized + Message,

Available on crate features UIResponder and UIView only.
Source

unsafe fn textViewDidChangeSelection(&self, text_view: &UITextView)
where Self: Sized + Message,

Available on crate features UIResponder and UIView only.
Source

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

Available on crate features 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.

Source

unsafe fn textView_willPresentEditMenuWithAnimator( &self, text_view: &UITextView, animator: &ProtocolObject<dyn UIEditMenuInteractionAnimating>, )
where Self: Sized + Message,

Available on crate features 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.

Source

unsafe fn textView_willDismissEditMenuWithAnimator( &self, text_view: &UITextView, animator: &ProtocolObject<dyn UIEditMenuInteractionAnimating>, )
where Self: Sized + Message,

Available on crate features 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.

Source

unsafe fn textView_primaryActionForTextItem_defaultAction( &self, text_view: &UITextView, text_item: &UITextItem, default_action: &UIAction, ) -> Option<Retained<UIAction>>
where Self: Sized + Message,

Available on crate features 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.

Source

unsafe fn textView_menuConfigurationForTextItem_defaultMenu( &self, text_view: &UITextView, text_item: &UITextItem, default_menu: &UIMenu, ) -> Option<Retained<UITextItemMenuConfiguration>>
where Self: Sized + Message,

Available on crate features 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.

Source

unsafe fn textView_textItemMenuWillDisplayForTextItem_animator( &self, text_view: &UITextView, text_item: &UITextItem, animator: &ProtocolObject<dyn UIContextMenuInteractionAnimating>, )
where Self: Sized + Message,

Available on crate features 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.

Source

unsafe fn textView_textItemMenuWillEndForTextItem_animator( &self, text_view: &UITextView, text_item: &UITextItem, animator: &ProtocolObject<dyn UIContextMenuInteractionAnimating>, )
where Self: Sized + Message,

Available on crate features 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.

Source

unsafe fn textViewWritingToolsWillBegin(&self, text_view: &UITextView)
where Self: Sized + Message,

Available on crate features 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

Source

unsafe fn textViewWritingToolsDidEnd(&self, text_view: &UITextView)
where Self: Sized + Message,

Available on crate features 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

Source

unsafe fn textView_writingToolsIgnoredRangesInEnclosingRange( &self, text_view: &UITextView, enclosing_range: NSRange, ) -> Retained<NSArray<NSValue>>
where Self: Sized + Message,

Available on crate features 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.

Source

unsafe fn textView_shouldInteractWithURL_inRange_interaction( &self, text_view: &UITextView, url: &NSURL, character_range: NSRange, interaction: UITextItemInteraction, ) -> bool
where Self: Sized + Message,

👎Deprecated: Replaced by primaryActionForTextItem: and menuConfigurationForTextItem: for additional customization options.
Available on crate features UIResponder and UITextItemInteraction and UIView only.
Source

unsafe fn textView_shouldInteractWithTextAttachment_inRange_interaction( &self, text_view: &UITextView, text_attachment: &NSTextAttachment, character_range: NSRange, interaction: UITextItemInteraction, ) -> bool
where Self: Sized + Message,

👎Deprecated: Replaced by primaryActionForTextItem: and menuConfigurationForTextItem: for additional customization options.
Available on crate features NSTextAttachment and UIResponder and UITextItemInteraction and UIView only.
Source

unsafe fn textView_shouldInteractWithURL_inRange( &self, text_view: &UITextView, url: &NSURL, character_range: NSRange, ) -> bool
where Self: Sized + Message,

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

unsafe fn textView_shouldInteractWithTextAttachment_inRange( &self, text_view: &UITextView, text_attachment: &NSTextAttachment, character_range: NSRange, ) -> bool
where Self: Sized + Message,

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

unsafe fn textView_willBeginFormattingWithViewController( &self, text_view: &UITextView, view_controller: &UITextFormattingViewController, )
where Self: Sized + Message,

Available on crate features 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.

Source

unsafe fn textView_didBeginFormattingWithViewController( &self, text_view: &UITextView, view_controller: &UITextFormattingViewController, )
where Self: Sized + Message,

Available on crate features 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.

Source

unsafe fn textView_willEndFormattingWithViewController( &self, text_view: &UITextView, view_controller: &UITextFormattingViewController, )
where Self: Sized + Message,

Available on crate features 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.

Source

unsafe fn textView_didEndFormattingWithViewController( &self, text_view: &UITextView, view_controller: &UITextFormattingViewController, )
where Self: Sized + Message,

Available on crate features 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.

Source

unsafe fn textView_insertInputSuggestion( &self, text_view: &UITextView, input_suggestion: &UIInputSuggestion, )
where Self: Sized + Message,

Available on crate features 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.

Trait Implementations§

Source§

impl ProtocolType for dyn UITextViewDelegate

Source§

const NAME: &'static str = "UITextViewDelegate"

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 UITextViewDelegate

Implementations on Foreign Types§

Source§

impl<T> UITextViewDelegate for ProtocolObject<T>

Implementors§