Interface UITextViewDelegate

    • Method Detail

      • textViewShouldChangeTextInRangeReplacementText

        default boolean textViewShouldChangeTextInRangeReplacementText​(@NotNull
                                                                       @NotNull UITextView textView,
                                                                       NSRange range,
                                                                       @NotNull
                                                                       @NotNull java.lang.String text)
      • textViewShouldInteractWithTextAttachmentInRange

        @Deprecated
        default boolean textViewShouldInteractWithTextAttachmentInRange​(@NotNull
                                                                        @NotNull UITextView textView,
                                                                        @NotNull
                                                                        @NotNull NSTextAttachment textAttachment,
                                                                        NSRange characterRange)
        Deprecated.
        API-Since: 7.0 Deprecated-Since: 10.0
      • textViewShouldInteractWithTextAttachmentInRangeInteraction

        @Deprecated
        default boolean textViewShouldInteractWithTextAttachmentInRangeInteraction​(@NotNull
                                                                                   @NotNull UITextView textView,
                                                                                   @NotNull
                                                                                   @NotNull NSTextAttachment textAttachment,
                                                                                   NSRange characterRange,
                                                                                   long interaction)
        Deprecated.
        API-Since: 10.0 Deprecated-Since: 17.0 Deprecated-Message: Replaced by primaryActionForTextItem: and menuConfigurationForTextItem: for additional customization options.
      • textViewShouldInteractWithURLInRange

        @Deprecated
        default boolean textViewShouldInteractWithURLInRange​(@NotNull
                                                             @NotNull UITextView textView,
                                                             @NotNull
                                                             @NotNull NSURL URL,
                                                             NSRange characterRange)
        Deprecated.
        API-Since: 7.0 Deprecated-Since: 10.0
      • textViewShouldInteractWithURLInRangeInteraction

        @Deprecated
        default boolean textViewShouldInteractWithURLInRangeInteraction​(@NotNull
                                                                        @NotNull UITextView textView,
                                                                        @NotNull
                                                                        @NotNull NSURL URL,
                                                                        NSRange characterRange,
                                                                        long interaction)
        Deprecated.
        API-Since: 10.0 Deprecated-Since: 17.0 Deprecated-Message: Replaced by primaryActionForTextItem: and menuConfigurationForTextItem: for additional customization options.
      • textViewDidBeginEditing

        default void textViewDidBeginEditing​(@NotNull
                                             @NotNull UITextView textView)
      • textViewDidChange

        default void textViewDidChange​(@NotNull
                                       @NotNull UITextView textView)
      • textViewDidChangeSelection

        default void textViewDidChangeSelection​(@NotNull
                                                @NotNull UITextView textView)
      • textViewDidEndEditing

        default void textViewDidEndEditing​(@NotNull
                                           @NotNull UITextView textView)
      • textViewShouldBeginEditing

        default boolean textViewShouldBeginEditing​(@NotNull
                                                   @NotNull UITextView textView)
      • textViewShouldEndEditing

        default boolean textViewShouldEndEditing​(@NotNull
                                                 @NotNull UITextView textView)
      • textViewEditMenuForTextInRangeSuggestedActions

        @Nullable
        default @Nullable UIMenu textViewEditMenuForTextInRangeSuggestedActions​(@NotNull
                                                                                @NotNull UITextView textView,
                                                                                NSRange range,
                                                                                @NotNull
                                                                                @NotNull NSArray<? extends UIMenuElement> suggestedActions)
        Asks the delegate for the menu to be shown for the specified text range.
        Parameters:
        textView - The text view requesting the menu.
        range - The text range for which the menu is presented for.
        suggestedActions - The actions and commands that the system suggests.
        Returns:
        Return a UIMenu describing the desired menu hierarchy. Return @c nil to present the default system menu. API-Since: 16.0
      • textViewWillDismissEditMenuWithAnimator

        default void textViewWillDismissEditMenuWithAnimator​(@NotNull
                                                             @NotNull UITextView textView,
                                                             @NotNull
                                                             @NotNull UIEditMenuInteractionAnimating animator)
        Called when the text view is about to dismiss the edit menu.
        Parameters:
        textView - The text view displaying the menu.
        animator - Dismissal animator. Add animations to this object to run them alongside the dismissal transition. API-Since: 16.0
      • textViewWillPresentEditMenuWithAnimator

        default void textViewWillPresentEditMenuWithAnimator​(@NotNull
                                                             @NotNull UITextView textView,
                                                             @NotNull
                                                             @NotNull UIEditMenuInteractionAnimating animator)
        Called when the text view is about to present the edit menu.
        Parameters:
        textView - The text view displaying the menu.
        animator - Appearance animator. Add animations to this object to run them alongside the appearance transition. API-Since: 16.0
      • textViewMenuConfigurationForTextItemDefaultMenu

        @Nullable
        default @Nullable UITextItemMenuConfiguration textViewMenuConfigurationForTextItemDefaultMenu​(@NotNull
                                                                                                      @NotNull UITextView textView,
                                                                                                      @NotNull
                                                                                                      @NotNull UITextItem textItem,
                                                                                                      @NotNull
                                                                                                      @NotNull UIMenu defaultMenu)
        Asks the delegate for the menu configuration to be performed when interacting with a text item.
        Parameters:
        textView - The text view requesting the menu.
        textItem - The text item for performing said action.
        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 @c nil to prevent the menu from being presented. API-Since: 17.0
      • textViewPrimaryActionForTextItemDefaultAction

        @Nullable
        default @Nullable UIAction textViewPrimaryActionForTextItemDefaultAction​(@NotNull
                                                                                 @NotNull UITextView textView,
                                                                                 @NotNull
                                                                                 @NotNull UITextItem textItem,
                                                                                 @NotNull
                                                                                 @NotNull UIAction defaultAction)
        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.
        Parameters:
        textView - The text view requesting the primary action.
        textItem - The text item for performing said action.
        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 @c nil to prevent the action from being performed. API-Since: 17.0
      • textViewTextItemMenuWillDisplayForTextItemAnimator

        default void textViewTextItemMenuWillDisplayForTextItemAnimator​(@NotNull
                                                                        @NotNull UITextView textView,
                                                                        @NotNull
                                                                        @NotNull UITextItem textItem,
                                                                        @NotNull
                                                                        @NotNull UIContextMenuInteractionAnimating animator)
        Informs the delegate that a text item menu is about to be presented with the specified animator.
        Parameters:
        textView - The text view showing the menu.
        textItem - The text item for performing said action.
        animator - Appearance animator. Add animations to this object to run them alongside the appearance transition. API-Since: 17.0
      • textViewTextItemMenuWillEndForTextItemAnimator

        default void textViewTextItemMenuWillEndForTextItemAnimator​(@NotNull
                                                                    @NotNull UITextView textView,
                                                                    @NotNull
                                                                    @NotNull UITextItem textItem,
                                                                    @NotNull
                                                                    @NotNull UIContextMenuInteractionAnimating animator)
        Informs the delegate that a text item menu is about to be dismissed with the specified animator.
        Parameters:
        textView - The text view showing the menu.
        textItem - The text item for performing said action.
        animator - Dismissal animator. Add animations to this object to run them alongside the dismissal transition. API-Since: 17.0