Package apple.uikit

Class UITextField

    • Constructor Detail

      • UITextField

        protected UITextField​(org.moe.natj.general.Pointer peer)
    • Method Detail

      • accessInstanceVariablesDirectly

        public static boolean accessInstanceVariablesDirectly()
      • allocWithZone

        public static java.lang.Object allocWithZone​(org.moe.natj.general.ptr.VoidPtr zone)
      • appearance

        public static java.lang.Object appearance()
      • appearanceForTraitCollection

        public static java.lang.Object appearanceForTraitCollection​(UITraitCollection trait)
      • appearanceForTraitCollectionWhenContainedIn

        @Deprecated
        public static java.lang.Object appearanceForTraitCollectionWhenContainedIn​(UITraitCollection trait,
                                                                                   UIAppearanceContainer ContainerClass,
                                                                                   java.lang.Object... varargs)
        Deprecated.
      • appearanceForTraitCollectionWhenContainedInInstancesOfClasses

        public static java.lang.Object appearanceForTraitCollectionWhenContainedInInstancesOfClasses​(UITraitCollection trait,
                                                                                                     NSArray<?> containerTypes)
      • appearanceWhenContainedIn

        @Deprecated
        public static java.lang.Object appearanceWhenContainedIn​(UIAppearanceContainer ContainerClass,
                                                                 java.lang.Object... varargs)
        Deprecated.
      • appearanceWhenContainedInInstancesOfClasses

        public static java.lang.Object appearanceWhenContainedInInstancesOfClasses​(NSArray<?> containerTypes)
      • areAnimationsEnabled

        public static boolean areAnimationsEnabled()
      • automaticallyNotifiesObserversForKey

        public static boolean automaticallyNotifiesObserversForKey​(java.lang.String key)
      • beginAnimationsContext

        public static void beginAnimationsContext​(java.lang.String animationID,
                                                  org.moe.natj.general.ptr.VoidPtr context)
      • cancelPreviousPerformRequestsWithTarget

        public static void cancelPreviousPerformRequestsWithTarget​(java.lang.Object aTarget)
      • cancelPreviousPerformRequestsWithTargetSelectorObject

        public static void cancelPreviousPerformRequestsWithTargetSelectorObject​(java.lang.Object aTarget,
                                                                                 org.moe.natj.objc.SEL aSelector,
                                                                                 java.lang.Object anArgument)
      • classFallbacksForKeyedArchiver

        public static NSArray<java.lang.String> classFallbacksForKeyedArchiver()
      • classForKeyedUnarchiver

        public static org.moe.natj.objc.Class classForKeyedUnarchiver()
      • clearTextInputContextIdentifier

        public static void clearTextInputContextIdentifier​(java.lang.String identifier)
      • commitAnimations

        public static void commitAnimations()
      • debugDescription_static

        public static java.lang.String debugDescription_static()
      • description_static

        public static java.lang.String description_static()
      • hash_static

        public static long hash_static()
      • inheritedAnimationDuration

        public static double inheritedAnimationDuration()
      • instanceMethodSignatureForSelector

        public static NSMethodSignature instanceMethodSignatureForSelector​(org.moe.natj.objc.SEL aSelector)
      • instancesRespondToSelector

        public static boolean instancesRespondToSelector​(org.moe.natj.objc.SEL aSelector)
      • isSubclassOfClass

        public static boolean isSubclassOfClass​(org.moe.natj.objc.Class aClass)
      • keyPathsForValuesAffectingValueForKey

        public static NSSet<java.lang.String> keyPathsForValuesAffectingValueForKey​(java.lang.String key)
      • layerClass

        public static org.moe.natj.objc.Class layerClass()
      • new_objc

        public static java.lang.Object new_objc()
      • requiresConstraintBasedLayout

        public static boolean requiresConstraintBasedLayout()
      • resolveClassMethod

        public static boolean resolveClassMethod​(org.moe.natj.objc.SEL sel)
      • resolveInstanceMethod

        public static boolean resolveInstanceMethod​(org.moe.natj.objc.SEL sel)
      • setAnimationBeginsFromCurrentState

        public static void setAnimationBeginsFromCurrentState​(boolean fromCurrentState)
      • setAnimationCurve

        public static void setAnimationCurve​(long curve)
      • setAnimationDelay

        public static void setAnimationDelay​(double delay)
      • setAnimationDelegate

        public static void setAnimationDelegate​(java.lang.Object delegate)
      • setAnimationDidStopSelector

        public static void setAnimationDidStopSelector​(org.moe.natj.objc.SEL selector)
      • setAnimationDuration_static

        public static void setAnimationDuration_static​(double duration)
      • setAnimationRepeatAutoreverses

        public static void setAnimationRepeatAutoreverses​(boolean repeatAutoreverses)
      • setAnimationRepeatCount_static

        public static void setAnimationRepeatCount_static​(float repeatCount)
      • setAnimationStartDate

        public static void setAnimationStartDate​(NSDate startDate)
      • setAnimationTransitionForViewCache

        public static void setAnimationTransitionForViewCache​(long transition,
                                                              UIView view,
                                                              boolean cache)
      • setAnimationWillStartSelector

        public static void setAnimationWillStartSelector​(org.moe.natj.objc.SEL selector)
      • setAnimationsEnabled

        public static void setAnimationsEnabled​(boolean enabled)
      • setVersion_static

        public static void setVersion_static​(long aVersion)
      • superclass_static

        public static org.moe.natj.objc.Class superclass_static()
      • userInterfaceLayoutDirectionForSemanticContentAttribute

        public static long userInterfaceLayoutDirectionForSemanticContentAttribute​(long attribute)
      • userInterfaceLayoutDirectionForSemanticContentAttributeRelativeToLayoutDirection

        public static long userInterfaceLayoutDirectionForSemanticContentAttributeRelativeToLayoutDirection​(long semanticContentAttribute,
                                                                                                            long layoutDirection)
      • version_static

        public static long version_static()
      • adjustsFontForContentSizeCategory

        public boolean adjustsFontForContentSizeCategory()
        Description copied from interface: UIContentSizeCategoryAdjusting
        Indicates whether the corresponding element should automatically update its font when the device’s UIContentSizeCategory is changed. For this property to take effect, the element’s font must be one of the following: - a font vended using +preferredFontForTextStyle: or +preferredFontForTextStyle:compatibleWithTraitCollection: with a valid UIFontTextStyle - a font vended using - [UIFontMetrics scaledFontForFont:] or one of its variants
        Specified by:
        adjustsFontForContentSizeCategory in interface UIContentSizeCategoryAdjusting
      • adjustsFontSizeToFitWidth

        public boolean adjustsFontSizeToFitWidth()
        default is NO. if YES, text will shrink to minFontSize along baseline
      • allowsEditingTextAttributes

        public boolean allowsEditingTextAttributes()
        default is NO. allows editing text attributes with style operations and pasting rich text
      • _appearance

        public java.lang.Object _appearance()
        Description copied from interface: UIAppearance
        To customize the appearance of all instances of a class, send the relevant appearance modification messages to the appearance proxy for the class. For example, to modify the bar tint color for all UINavigationBar instances: [[UINavigationBar appearance] setBarTintColor:myColor]; Note for iOS7: On iOS7 the tintColor property has moved to UIView, and now has special inherited behavior described in UIView.h. This inherited behavior can conflict with the appearance proxy, and therefore tintColor is now disallowed with the appearance proxy.
        Specified by:
        _appearance in interface UIAppearance
        Overrides:
        _appearance in class UIControl
      • _appearanceWhenContainedIn

        @Deprecated
        public java.lang.Object _appearanceWhenContainedIn​(UIAppearanceContainer ContainerClass,
                                                           java.lang.Object... varargs)
        Deprecated.
        Description copied from interface: UIAppearance
        To customize the appearances for instances of a class contained within an instance of a container class, or instances in a hierarchy, use +appearanceWhenContainedInInstancesOfClasses: for the appropriate appearance proxy. For example: [[UINavigationBar appearanceWhenContainedInInstancesOfClasses:@[[UISplitViewController class]]] setBarTintColor:myColor]; [[UINavigationBar appearanceWhenContainedInInstancesOfClasses:@[[UITabBarController class], [UISplitViewController class]]] setBarTintColor:myTabbedNavBarColor]; In any given view hierarchy the outermost appearance proxy wins. Specificity (depth of the chain) is the tie-breaker. In other words, the containment statement is treated as a partial ordering. Given a concrete ordering (actual subview hierarchy), we select the partial ordering that is the first unique match when reading the actual hierarchy from the window down.
        Specified by:
        _appearanceWhenContainedIn in interface UIAppearance
        Overrides:
        _appearanceWhenContainedIn in class UIControl
      • attributedPlaceholder

        public NSAttributedString attributedPlaceholder()
        default is nil
      • background

        public UIImage background()
        default is nil. draw in border rect. image should be stretchable
      • beginFloatingCursorAtPoint

        public void beginFloatingCursorAtPoint​(CGPoint point)
        Description copied from interface: UITextInput
        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.
        Specified by:
        beginFloatingCursorAtPoint in interface UITextInput
      • borderRectForBounds

        public CGRect borderRectForBounds​(CGRect bounds)
        drawing and positioning overrides
      • borderStyle

        public long borderStyle()
        default is UITextBorderStyleNone. If set to UITextBorderStyleRoundedRect, custom background images are ignored.
      • clearButtonMode

        public long clearButtonMode()
        sets when the clear button shows up. default is UITextFieldViewModeNever
      • clearButtonRectForBounds

        public CGRect clearButtonRectForBounds​(CGRect bounds)
      • clearsOnBeginEditing

        public boolean clearsOnBeginEditing()
        default is NO which moves cursor to location clicked. if YES, all text cleared
      • clearsOnInsertion

        public boolean clearsOnInsertion()
        defaults to NO. if YES, the selection UI is hidden, and inserting text will replace the contents of the field. changing the selection will automatically set this to NO.
      • defaultTextAttributes

        public NSDictionary<java.lang.String,​?> defaultTextAttributes()
        applies attributes to the full range of text. Unset attributes act like default values.
      • dictationRecordingDidEnd

        public void dictationRecordingDidEnd()
        Description copied from interface: UITextInput
        These are optional methods for clients that wish to know when there are pending dictation results.
        Specified by:
        dictationRecordingDidEnd in interface UITextInput
      • disabledBackground

        public UIImage disabledBackground()
        default is nil. ignored if background not set. image should be stretchable
      • drawPlaceholderInRect

        public void drawPlaceholderInRect​(CGRect rect)
      • drawTextInRect

        public void drawTextInRect​(CGRect rect)
      • editingRectForBounds

        public CGRect editingRectForBounds​(CGRect bounds)
      • enablesReturnKeyAutomatically

        public boolean enablesReturnKeyAutomatically()
        Description copied from interface: UITextInputTraits
        default is NO (when YES, will automatically disable return key when text widget has zero-length contents, and will automatically enable when text widget has non-zero-length contents)
        Specified by:
        enablesReturnKeyAutomatically in interface UITextInputTraits
      • font

        public UIFont font()
        default is nil. use system font 12 pt
      • inputView

        public UIView inputView()
        Presented when object becomes first responder. If set to nil, reverts to following responder chain. If set while first responder, will not take effect until reloadInputViews is called.
        Overrides:
        inputView in class UIResponder
      • insertDictationResult

        public void insertDictationResult​(NSArray<? extends UIDictationPhrase> dictationResult)
        Description copied from interface: UITextInput
        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.
        Specified by:
        insertDictationResult in interface UITextInput
      • insertDictationResultPlaceholder

        public java.lang.Object insertDictationResultPlaceholder()
        Description copied from interface: UITextInput
        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).
        Specified by:
        insertDictationResultPlaceholder in interface UITextInput
      • insertText

        public void insertText​(java.lang.String text)
        Specified by:
        insertText in interface UIKeyInput
      • isEditing

        public boolean isEditing()
      • leftView

        public UIView leftView()
        e.g. magnifying glass
      • leftViewMode

        public long leftViewMode()
        sets when the left view shows up. default is UITextFieldViewModeNever
      • leftViewRectForBounds

        public CGRect leftViewRectForBounds​(CGRect bounds)
      • minimumFontSize

        public double minimumFontSize()
        default is 0.0. actual min may be pinned to something readable. used if adjustsFontSizeToFitWidth is YES
      • placeholder

        public java.lang.String placeholder()
        default is nil. string is drawn 70% gray
      • placeholderRectForBounds

        public CGRect placeholderRectForBounds​(CGRect bounds)
      • removeDictationResultPlaceholderWillInsertResult

        public void removeDictationResultPlaceholderWillInsertResult​(java.lang.Object placeholder,
                                                                     boolean willInsertResult)
        Description copied from interface: UITextInput
        willInsertResult will be NO if the recognition failed.
        Specified by:
        removeDictationResultPlaceholderWillInsertResult in interface UITextInput
      • rightView

        public UIView rightView()
        e.g. bookmarks button
      • rightViewMode

        public long rightViewMode()
        sets when the right view shows up. default is UITextFieldViewModeNever
      • rightViewRectForBounds

        public CGRect rightViewRectForBounds​(CGRect bounds)
      • selectedTextRange

        public UITextRange selectedTextRange()
        Description copied from interface: UITextInput
        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.
        Specified by:
        selectedTextRange in interface UITextInput
      • selectionAffinity

        public long selectionAffinity()
        Description copied from interface: UITextInput
        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.
        Specified by:
        selectionAffinity in interface UITextInput
      • setAdjustsFontForContentSizeCategory

        public void setAdjustsFontForContentSizeCategory​(boolean value)
        Description copied from interface: UIContentSizeCategoryAdjusting
        Indicates whether the corresponding element should automatically update its font when the device’s UIContentSizeCategory is changed. For this property to take effect, the element’s font must be one of the following: - a font vended using +preferredFontForTextStyle: or +preferredFontForTextStyle:compatibleWithTraitCollection: with a valid UIFontTextStyle - a font vended using - [UIFontMetrics scaledFontForFont:] or one of its variants
        Specified by:
        setAdjustsFontForContentSizeCategory in interface UIContentSizeCategoryAdjusting
      • setAdjustsFontSizeToFitWidth

        public void setAdjustsFontSizeToFitWidth​(boolean value)
        default is NO. if YES, text will shrink to minFontSize along baseline
      • setAllowsEditingTextAttributes

        public void setAllowsEditingTextAttributes​(boolean value)
        default is NO. allows editing text attributes with style operations and pasting rich text
      • setAttributedPlaceholder

        public void setAttributedPlaceholder​(NSAttributedString value)
        default is nil
      • setAttributedText

        public void setAttributedText​(NSAttributedString value)
        default is nil
      • setBackground

        public void setBackground​(UIImage value)
        default is nil. draw in border rect. image should be stretchable
      • setBorderStyle

        public void setBorderStyle​(long value)
        default is UITextBorderStyleNone. If set to UITextBorderStyleRoundedRect, custom background images are ignored.
      • setClearButtonMode

        public void setClearButtonMode​(long value)
        sets when the clear button shows up. default is UITextFieldViewModeNever
      • setClearsOnBeginEditing

        public void setClearsOnBeginEditing​(boolean value)
        default is NO which moves cursor to location clicked. if YES, all text cleared
      • setClearsOnInsertion

        public void setClearsOnInsertion​(boolean value)
        defaults to NO. if YES, the selection UI is hidden, and inserting text will replace the contents of the field. changing the selection will automatically set this to NO.
      • setDefaultTextAttributes

        public void setDefaultTextAttributes​(NSDictionary<java.lang.String,​?> value)
        applies attributes to the full range of text. Unset attributes act like default values.
      • setDelegate_unsafe

        public void setDelegate_unsafe​(UITextFieldDelegate value)
        default is nil. weak reference
      • setDelegate

        public void setDelegate​(UITextFieldDelegate value)
        default is nil. weak reference
      • setDisabledBackground

        public void setDisabledBackground​(UIImage value)
        default is nil. ignored if background not set. image should be stretchable
      • setEnablesReturnKeyAutomatically

        public void setEnablesReturnKeyAutomatically​(boolean value)
        Description copied from interface: UITextInputTraits
        default is NO (when YES, will automatically disable return key when text widget has zero-length contents, and will automatically enable when text widget has non-zero-length contents)
        Specified by:
        setEnablesReturnKeyAutomatically in interface UITextInputTraits
      • setFont

        public void setFont​(UIFont value)
        default is nil. use system font 12 pt
      • setInputAccessoryView

        public void setInputAccessoryView​(UIView value)
      • setInputView

        public void setInputView​(UIView value)
        Presented when object becomes first responder. If set to nil, reverts to following responder chain. If set while first responder, will not take effect until reloadInputViews is called.
      • setLeftView

        public void setLeftView​(UIView value)
        e.g. magnifying glass
      • setLeftViewMode

        public void setLeftViewMode​(long value)
        sets when the left view shows up. default is UITextFieldViewModeNever
      • setMarkedTextSelectedRange

        public void setMarkedTextSelectedRange​(java.lang.String markedText,
                                               NSRange selectedRange)
        Description copied from interface: UITextInput
        selectedRange is a range within the markedText
        Specified by:
        setMarkedTextSelectedRange in interface UITextInput
      • setMinimumFontSize

        public void setMinimumFontSize​(double value)
        default is 0.0. actual min may be pinned to something readable. used if adjustsFontSizeToFitWidth is YES
      • setPlaceholder

        public void setPlaceholder​(java.lang.String value)
        default is nil. string is drawn 70% gray
      • setReturnKeyType

        public void setReturnKeyType​(long value)
        Description copied from interface: UITextInputTraits
        default is UIReturnKeyDefault (See note under UIReturnKeyType enum)
        Specified by:
        setReturnKeyType in interface UITextInputTraits
      • setRightView

        public void setRightView​(UIView value)
        e.g. bookmarks button
      • setRightViewMode

        public void setRightViewMode​(long value)
        sets when the right view shows up. default is UITextFieldViewModeNever
      • setSelectedTextRange

        public void setSelectedTextRange​(UITextRange value)
        Description copied from interface: UITextInput
        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.
        Specified by:
        setSelectedTextRange in interface UITextInput
      • setSelectionAffinity

        public void setSelectionAffinity​(long value)
        Description copied from interface: UITextInput
        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.
        Specified by:
        setSelectionAffinity in interface UITextInput
      • setText

        public void setText​(java.lang.String value)
        default is nil
      • setTextAlignment

        public void setTextAlignment​(long value)
        default is NSLeftTextAlignment
      • setTextColor

        public void setTextColor​(UIColor value)
        default is nil. use opaque black
      • setTypingAttributes

        public void setTypingAttributes​(NSDictionary<java.lang.String,​?> value)
        automatically resets when the selection changes
      • text

        public java.lang.String text()
        default is nil
      • textAlignment

        public long textAlignment()
        default is NSLeftTextAlignment
      • textColor

        public UIColor textColor()
        default is nil. use opaque black
      • textInputView

        public UIView textInputView()
        Description copied from interface: UITextInput
        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.
        Specified by:
        textInputView in interface UITextInput
      • textRectForBounds

        public CGRect textRectForBounds​(CGRect bounds)
      • textStylingAtPositionInDirection

        public NSDictionary<java.lang.String,​?> textStylingAtPositionInDirection​(UITextPosition position,
                                                                                       long direction)
        Description copied from interface: UITextInput
        Text styling information can affect, for example, the appearance of a correction rect. Returns a dictionary containing NSAttributedString keys.
        Specified by:
        textStylingAtPositionInDirection in interface UITextInput
      • typingAttributes

        public NSDictionary<java.lang.String,​?> typingAttributes()
        automatically resets when the selection changes
      • isTextDragActive

        public boolean isTextDragActive()
        Description copied from interface: UITextDraggable
        Returns whether this control currently has at least one active drag session.
        Specified by:
        isTextDragActive in interface UITextDraggable
      • isTextDropActive

        public boolean isTextDropActive()
        Description copied from interface: UITextDroppable
        Returns whether this control currently has at least one active drag session.
        Specified by:
        isTextDropActive in interface UITextDroppable
      • setTextDragDelegate_unsafe

        public void setTextDragDelegate_unsafe​(UITextDragDelegate value)
      • setTextDropDelegate_unsafe

        public void setTextDropDelegate_unsafe​(UITextDropDelegate value)
      • textDragInteraction

        public UIDragInteraction textDragInteraction()
        Description copied from interface: UITextDraggable
        The text drag interaction that UIKit installs on the text control. Use this to explicitly disable drag interactions on system text controls, if desired.
        Specified by:
        textDragInteraction in interface UITextDraggable
      • textDropInteraction

        public UIDropInteraction textDropInteraction()
        Description copied from interface: UITextDroppable
        The text drop interaction that UIKit installs on the text control. Use this to explicitly disable drop interactions on system text controls, if desired.
        Specified by:
        textDropInteraction in interface UITextDroppable
      • insertTextAlternativesStyle

        public void insertTextAlternativesStyle​(java.lang.String text,
                                                NSArray<java.lang.String> alternatives,
                                                long style)
        Description copied from interface: UITextInput
        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.
        Specified by:
        insertTextAlternativesStyle in interface UITextInput
      • insertTextPlaceholderWithSize

        public UITextPlaceholder insertTextPlaceholderWithSize​(CGSize size)
        Description copied from interface: UITextInput
        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`.
        Specified by:
        insertTextPlaceholderWithSize in interface UITextInput
      • initWithFramePrimaryAction

        public UITextField initWithFramePrimaryAction​(CGRect frame,
                                                      UIAction primaryAction)
        Description copied from class: UIControl
        Initializes the control and adds primaryAction for the UIControlEventPrimaryActionTriggered control event. Subclasses of UIControl may alter or add behaviors around the usage of primaryAction, see subclass documentation of this initializer for additional information.
        Overrides:
        initWithFramePrimaryAction in class UIControl