Interface UITextInput

    • Method Detail

      • baseWritingDirectionForPositionInDirection

        long baseWritingDirectionForPositionInDirection​(UITextPosition position,
                                                        long direction)
        Writing direction
      • beginFloatingCursorAtPoint

        default void beginFloatingCursorAtPoint​(CGPoint point)
        The following three optional methods are for clients that wish to display a floating cursor to guide user manipulation of the selected text range via the system-provided keyboard. If a client does not implement these methods, user feedback will be limited to the outcome after setting the selected text range using positions resulting from hit testing.
      • beginningOfDocument

        UITextPosition beginningOfDocument()
        The end and beginning of the the text document.
      • characterOffsetOfPositionWithinRange

        default long characterOffsetOfPositionWithinRange​(UITextPosition position,
                                                          UITextRange range)
      • characterRangeByExtendingPositionInDirection

        UITextRange characterRangeByExtendingPositionInDirection​(UITextPosition position,
                                                                 long direction)
      • comparePositionToPosition

        long comparePositionToPosition​(UITextPosition position,
                                       UITextPosition other)
        Simple evaluation of positions
      • dictationRecognitionFailed

        default void dictationRecognitionFailed()
      • dictationRecordingDidEnd

        default void dictationRecordingDidEnd()
        These are optional methods for clients that wish to know when there are pending dictation results.
      • endFloatingCursor

        default void endFloatingCursor()
      • firstRectForRange

        CGRect firstRectForRange​(UITextRange range)
        Geometry used to provide, for example, a correction rect.
      • frameForDictationResultPlaceholder

        default CGRect frameForDictationResultPlaceholder​(java.lang.Object placeholder)
      • inputDelegate

        UITextInputDelegate inputDelegate()
        A system-provied input delegate is assigned when the system is interested in input changes.
      • insertDictationResult

        default void insertDictationResult​(NSArray<? extends UIDictationPhrase> dictationResult)
        This is an optional method for clients that wish to support dictation phrase alternatives. If they do not implement this method, dictation will just insert the most likely interpretation of what was spoken via -insertText:. dictationResult is an array of UIDictationPhrases.
      • insertDictationResultPlaceholder

        default java.lang.Object insertDictationResultPlaceholder()
        The following three optional methods are for clients that wish to support a placeholder for pending dictation results. -insertDictationPlaceholder must return a reference to the placeholder. This reference will be used to identify the placeholder by the other methods (there may be more than one placeholder).
      • markedTextRange

        UITextRange markedTextRange()
        Nil if no marked text.
      • markedTextStyle

        NSDictionary<java.lang.String,​?> markedTextStyle()
        Describes how the marked text should be drawn.
      • positionFromPositionInDirectionOffset

        UITextPosition positionFromPositionInDirectionOffset​(UITextPosition position,
                                                             long direction,
                                                             long offset)
      • positionWithinRangeAtCharacterOffset

        default UITextPosition positionWithinRangeAtCharacterOffset​(UITextRange range,
                                                                    long offset)
        To be implemented if there is not a one-to-one correspondence between text positions within range and character offsets into the associated string.
      • positionWithinRangeFarthestInDirection

        UITextPosition positionWithinRangeFarthestInDirection​(UITextRange range,
                                                              long direction)
        Layout questions.
      • removeDictationResultPlaceholderWillInsertResult

        default void removeDictationResultPlaceholderWillInsertResult​(java.lang.Object placeholder,
                                                                      boolean willInsertResult)
        willInsertResult will be NO if the recognition failed.
      • replaceRangeWithText

        void replaceRangeWithText​(UITextRange range,
                                  java.lang.String text)
      • selectedTextRange

        UITextRange selectedTextRange()
        Text may have a selection, either zero-length (a caret) or ranged. Editing operations are always performed on the text from this selection. nil corresponds to no selection.
      • selectionAffinity

        default long selectionAffinity()
        Selection affinity determines whether, for example, the insertion point appears after the last character on a line or before the first character on the following line in cases where text wraps across line boundaries.
      • setBaseWritingDirectionForRange

        void setBaseWritingDirectionForRange​(long writingDirection,
                                             UITextRange range)
      • setInputDelegate

        void setInputDelegate​(UITextInputDelegate value)
        A system-provied input delegate is assigned when the system is interested in input changes.
      • setMarkedTextSelectedRange

        void setMarkedTextSelectedRange​(java.lang.String markedText,
                                        NSRange selectedRange)
        selectedRange is a range within the markedText
      • setMarkedTextStyle

        void setMarkedTextStyle​(NSDictionary<java.lang.String,​?> value)
        Describes how the marked text should be drawn.
      • setSelectedTextRange

        void setSelectedTextRange​(UITextRange value)
        Text may have a selection, either zero-length (a caret) or ranged. Editing operations are always performed on the text from this selection. nil corresponds to no selection.
      • setSelectionAffinity

        default void setSelectionAffinity​(long value)
        Selection affinity determines whether, for example, the insertion point appears after the last character on a line or before the first character on the following line in cases where text wraps across line boundaries.
      • shouldChangeTextInRangeReplacementText

        default boolean shouldChangeTextInRangeReplacementText​(UITextRange range,
                                                               java.lang.String text)
        return NO to not change text
      • textInRange

        java.lang.String textInRange​(UITextRange range)
        Methods for manipulating text.
      • textInputView

        default UIView textInputView()
        An affiliated view that provides a coordinate system for all geometric values in this protocol. If unimplmeented, the first view in the responder chain will be selected.
      • textStylingAtPositionInDirection

        default NSDictionary<java.lang.String,​?> textStylingAtPositionInDirection​(UITextPosition position,
                                                                                        long direction)
        Text styling information can affect, for example, the appearance of a correction rect. Returns a dictionary containing NSAttributedString keys.
      • tokenizer

        UITextInputTokenizer tokenizer()
        A tokenizer must be provided to inform the text input system about text units of varying granularity.
      • unmarkText

        void unmarkText()
      • updateFloatingCursorAtPoint

        default void updateFloatingCursorAtPoint​(CGPoint point)
      • insertTextAlternativesStyle

        default void insertTextAlternativesStyle​(java.lang.String text,
                                                 NSArray<java.lang.String> alternatives,
                                                 long style)
        This is an optional method for clients that wish to support text phrase alternatives. If they do not implement this method, the text will be inserted by -insertText: without the phase alternatives.
      • insertTextPlaceholderWithSize

        default UITextPlaceholder insertTextPlaceholderWithSize​(CGSize size)
        Insert a placeholder If `size.height` is <= 0, then the placeholder is inline and line height. If `size.height` is > 0, then the placeholder is treated as a paragraph of height `size.height`.
      • removeTextPlaceholder

        default void removeTextPlaceholder​(UITextPlaceholder textPlaceholder)
        Remove the placeholder.
      • setAttributedMarkedTextSelectedRange

        default void setAttributedMarkedTextSelectedRange​(NSAttributedString markedText,
                                                          NSRange selectedRange)
        set attributedString as markedText, selectedRange is a range within the markedText