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 { ... }
}
UIScrollView
and UITextView
only.Expand description
Provided Methods§
unsafe fn textViewShouldBeginEditing(&self, text_view: &UITextView) -> bool
UIResponder
and UIView
only.unsafe fn textViewShouldEndEditing(&self, text_view: &UITextView) -> bool
UIResponder
and UIView
only.unsafe fn textViewDidBeginEditing(&self, text_view: &UITextView)
UIResponder
and UIView
only.unsafe fn textViewDidEndEditing(&self, text_view: &UITextView)
UIResponder
and UIView
only.unsafe fn textView_shouldChangeTextInRange_replacementText( &self, text_view: &UITextView, range: NSRange, text: &NSString, ) -> bool
UIResponder
and UIView
only.unsafe fn textViewDidChange(&self, text_view: &UITextView)
UIResponder
and UIView
only.unsafe fn textViewDidChangeSelection(&self, text_view: &UITextView)
UIResponder
and UIView
only.Sourceunsafe fn textView_editMenuForTextInRange_suggestedActions(
&self,
text_view: &UITextView,
range: NSRange,
suggested_actions: &NSArray<UIMenuElement>,
) -> Option<Retained<UIMenu>>
Available on crate features UIMenu
and UIMenuElement
and UIResponder
and UIView
only.
unsafe 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
nil
to present the default system menu.
Sourceunsafe fn textView_willPresentEditMenuWithAnimator(
&self,
text_view: &UITextView,
animator: &ProtocolObject<dyn UIEditMenuInteractionAnimating>,
)
Available on crate features UIEditMenuInteraction
and UIResponder
and UIView
only.
unsafe 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.
Sourceunsafe fn textView_willDismissEditMenuWithAnimator(
&self,
text_view: &UITextView,
animator: &ProtocolObject<dyn UIEditMenuInteractionAnimating>,
)
Available on crate features UIEditMenuInteraction
and UIResponder
and UIView
only.
unsafe 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.
Sourceunsafe fn 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.
unsafe 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
nil
to 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
nil
to prevent the menu from being presented.
Sourceunsafe fn 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.
unsafe 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.
Sourceunsafe fn 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.
unsafe 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.
Sourceunsafe fn textViewWritingToolsWillBegin(&self, text_view: &UITextView)
Available on crate features UIResponder
and UIView
only.
unsafe 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
Sourceunsafe fn textViewWritingToolsDidEnd(&self, text_view: &UITextView)
Available on crate features UIResponder
and UIView
only.
unsafe 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
Sourceunsafe fn textView_writingToolsIgnoredRangesInEnclosingRange(
&self,
text_view: &UITextView,
enclosing_range: NSRange,
) -> Retained<NSArray<NSValue>>
Available on crate features UIResponder
and UIView
only.
unsafe 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.
unsafe fn textView_shouldInteractWithURL_inRange_interaction( &self, text_view: &UITextView, url: &NSURL, character_range: NSRange, interaction: UITextItemInteraction, ) -> bool
UIResponder
and UITextItemInteraction
and UIView
only.unsafe 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.unsafe fn textView_shouldInteractWithURL_inRange( &self, text_view: &UITextView, url: &NSURL, character_range: NSRange, ) -> bool
UIResponder
and UIView
only.unsafe fn textView_shouldInteractWithTextAttachment_inRange( &self, text_view: &UITextView, text_attachment: &NSTextAttachment, character_range: NSRange, ) -> bool
NSTextAttachment
and UIResponder
and UIView
only.Sourceunsafe fn textView_willBeginFormattingWithViewController(
&self,
text_view: &UITextView,
view_controller: &UITextFormattingViewController,
)
Available on crate features UIResponder
and UITextFormattingViewController
and UIView
and UIViewController
only.
unsafe 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.
Sourceunsafe fn textView_didBeginFormattingWithViewController(
&self,
text_view: &UITextView,
view_controller: &UITextFormattingViewController,
)
Available on crate features UIResponder
and UITextFormattingViewController
and UIView
and UIViewController
only.
unsafe 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.
Sourceunsafe fn textView_willEndFormattingWithViewController(
&self,
text_view: &UITextView,
view_controller: &UITextFormattingViewController,
)
Available on crate features UIResponder
and UITextFormattingViewController
and UIView
and UIViewController
only.
unsafe 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.
Sourceunsafe fn textView_didEndFormattingWithViewController(
&self,
text_view: &UITextView,
view_controller: &UITextFormattingViewController,
)
Available on crate features UIResponder
and UITextFormattingViewController
and UIView
and UIViewController
only.
unsafe 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.
Sourceunsafe fn textView_insertInputSuggestion(
&self,
text_view: &UITextView,
input_suggestion: &UIInputSuggestion,
)
Available on crate features UIInputSuggestion
and UIResponder
and UIView
only.
unsafe 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.