Interface UITextFieldDelegate

    • Method Detail

      • textFieldShouldChangeCharactersInRangeReplacementString

        default boolean textFieldShouldChangeCharactersInRangeReplacementString​(@NotNull
                                                                                @NotNull UITextField textField,
                                                                                NSRange range,
                                                                                @NotNull
                                                                                @NotNull java.lang.String string)
        return NO to not change text
      • textFieldDidBeginEditing

        default void textFieldDidBeginEditing​(@NotNull
                                              @NotNull UITextField textField)
        became first responder
      • textFieldDidEndEditing

        default void textFieldDidEndEditing​(@NotNull
                                            @NotNull UITextField textField)
        may be called if forced even if shouldEndEditing returns NO (e.g. view removed from window) or endEditing:YES called
      • textFieldDidEndEditingReason

        default void textFieldDidEndEditingReason​(@NotNull
                                                  @NotNull UITextField textField,
                                                  long reason)
        if implemented, called in place of textFieldDidEndEditing: API-Since: 10.0
      • textFieldShouldBeginEditing

        default boolean textFieldShouldBeginEditing​(@NotNull
                                                    @NotNull UITextField textField)
        return NO to disallow editing.
      • textFieldShouldClear

        default boolean textFieldShouldClear​(@NotNull
                                             @NotNull UITextField textField)
        called when clear button pressed. return NO to ignore (no notifications)
      • textFieldShouldEndEditing

        default boolean textFieldShouldEndEditing​(@NotNull
                                                  @NotNull UITextField textField)
        return YES to allow editing to stop and to resign first responder status. NO to disallow the editing session to end
      • textFieldShouldReturn

        default boolean textFieldShouldReturn​(@NotNull
                                              @NotNull UITextField textField)
        called when 'return' key pressed. return NO to ignore.
      • textFieldDidChangeSelection

        default void textFieldDidChangeSelection​(@NotNull
                                                 @NotNull UITextField textField)
        API-Since: 13.0
      • textFieldEditMenuForCharactersInRangeSuggestedActions

        @Nullable
        default @Nullable UIMenu textFieldEditMenuForCharactersInRangeSuggestedActions​(@NotNull
                                                                                       @NotNull UITextField textField,
                                                                                       NSRange range,
                                                                                       @NotNull
                                                                                       @NotNull NSArray<? extends UIMenuElement> suggestedActions)
        Asks the delegate for the menu to be shown for the specified text range.
        Parameters:
        textField - The text field requesting the menu.
        range - The characters 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
      • textFieldWillDismissEditMenuWithAnimator

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

        default void textFieldWillPresentEditMenuWithAnimator​(@NotNull
                                                              @NotNull UITextField textField,
                                                              @NotNull
                                                              @NotNull UIEditMenuInteractionAnimating animator)
        Called when the text field is about to present the edit menu.
        Parameters:
        textField - The text field displaying the menu.
        animator - Appearance animator. Add animations to this object to run them alongside the appearance transition. API-Since: 16.0