Package apple.uikit

Class UIButton

    • Constructor Detail

      • UIButton

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

      • accessInstanceVariablesDirectly

        public static boolean accessInstanceVariablesDirectly()
      • alloc

        public static UIButton alloc()
      • 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)
      • buttonWithType

        public static UIButton buttonWithType​(long buttonType)
      • 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()
      • adjustsImageWhenDisabled

        public boolean adjustsImageWhenDisabled()
        default is YES. if YES, image is drawn lighter when disabled
      • adjustsImageWhenHighlighted

        public boolean adjustsImageWhenHighlighted()
        default is YES. if YES, image is drawn darker when highlighted(pressed)
      • _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
      • attributedTitleForState

        public NSAttributedString attributedTitleForState​(long state)
      • backgroundImageForState

        public UIImage backgroundImageForState​(long state)
      • backgroundRectForBounds

        public CGRect backgroundRectForBounds​(CGRect bounds)
        these return the rectangle for the background (assumes bounds), the content (image + title) and for the image and title separately. the content rect is calculated based on the title and image size and padding and then adjusted based on the control content alignment. there are no draw methods since the contents are rendered in separate subviews (UIImageView, UILabel)
      • buttonType

        public long buttonType()
      • contentEdgeInsets

        public UIEdgeInsets contentEdgeInsets()
        default is UIEdgeInsetsZero. On tvOS 10 or later, default is nonzero except for custom buttons.
      • contentRectForBounds

        public CGRect contentRectForBounds​(CGRect bounds)
      • currentAttributedTitle

        public NSAttributedString currentAttributedTitle()
        normal/highlighted/selected/disabled. can return nil
      • currentBackgroundImage

        public UIImage currentBackgroundImage()
        normal/highlighted/selected/disabled. can return nil
      • currentImage

        public UIImage currentImage()
        normal/highlighted/selected/disabled. can return nil
      • currentTitle

        public java.lang.String currentTitle()
        normal/highlighted/selected/disabled. can return nil
      • currentTitleColor

        public UIColor currentTitleColor()
        normal/highlighted/selected/disabled. always returns non-nil. default is white(1,1)
      • currentTitleShadowColor

        public UIColor currentTitleShadowColor()
        normal/highlighted/selected/disabled.
      • font

        @Deprecated
        public UIFont font()
        Deprecated.
      • imageEdgeInsets

        public UIEdgeInsets imageEdgeInsets()
        default is UIEdgeInsetsZero
      • imageForState

        public UIImage imageForState​(long state)
      • imageRectForContentRect

        public CGRect imageRectForContentRect​(CGRect contentRect)
      • lineBreakMode

        @Deprecated
        public long lineBreakMode()
        Deprecated.
      • reversesTitleShadowWhenHighlighted

        public boolean reversesTitleShadowWhenHighlighted()
        default is NO. if YES, shadow reverses to shift between engrave and emboss appearance
      • setAdjustsImageWhenDisabled

        public void setAdjustsImageWhenDisabled​(boolean value)
        default is YES. if YES, image is drawn lighter when disabled
      • setAdjustsImageWhenHighlighted

        public void setAdjustsImageWhenHighlighted​(boolean value)
        default is YES. if YES, image is drawn darker when highlighted(pressed)
      • setAttributedTitleForState

        public void setAttributedTitleForState​(NSAttributedString title,
                                               long state)
        default is nil. title is assumed to be single line
      • setBackgroundImageForState

        public void setBackgroundImageForState​(UIImage image,
                                               long state)
        default is nil
      • setContentEdgeInsets

        public void setContentEdgeInsets​(UIEdgeInsets value)
        default is UIEdgeInsetsZero. On tvOS 10 or later, default is nonzero except for custom buttons.
      • setFont

        @Deprecated
        public void setFont​(UIFont value)
        Deprecated.
      • setImageForState

        public void setImageForState​(UIImage image,
                                     long state)
        default is nil. should be same size if different for different states
      • setImageEdgeInsets

        public void setImageEdgeInsets​(UIEdgeInsets value)
        default is UIEdgeInsetsZero
      • setLineBreakMode

        @Deprecated
        public void setLineBreakMode​(long value)
        Deprecated.
      • setReversesTitleShadowWhenHighlighted

        public void setReversesTitleShadowWhenHighlighted​(boolean value)
        default is NO. if YES, shadow reverses to shift between engrave and emboss appearance
      • setShowsTouchWhenHighlighted

        public void setShowsTouchWhenHighlighted​(boolean value)
        default is NO. if YES, show a simple feedback (currently a glow) while highlighted
      • setTintColor

        public void setTintColor​(UIColor value)
        The tintColor is inherited through the superview hierarchy. See UIView for more information.
        Overrides:
        setTintColor in class UIView
      • setTitleForState

        public void setTitleForState​(java.lang.String title,
                                     long state)
        default is nil. title is assumed to be single line
      • setTitleColorForState

        public void setTitleColorForState​(UIColor color,
                                          long state)
        default is nil. use opaque white
      • setTitleEdgeInsets

        public void setTitleEdgeInsets​(UIEdgeInsets value)
        default is UIEdgeInsetsZero
      • setTitleShadowColorForState

        public void setTitleShadowColorForState​(UIColor color,
                                                long state)
        default is nil. use 50% black
      • setTitleShadowOffset

        @Deprecated
        public void setTitleShadowOffset​(CGSize value)
        Deprecated.
      • showsTouchWhenHighlighted

        public boolean showsTouchWhenHighlighted()
        default is NO. if YES, show a simple feedback (currently a glow) while highlighted
      • tintColor

        public UIColor tintColor()
        The tintColor is inherited through the superview hierarchy. See UIView for more information.
        Overrides:
        tintColor in class UIView
      • titleColorForState

        public UIColor titleColorForState​(long state)
      • titleEdgeInsets

        public UIEdgeInsets titleEdgeInsets()
        default is UIEdgeInsetsZero
      • titleForState

        public java.lang.String titleForState​(long state)
        these getters only take a single state value
      • titleLabel

        public UILabel titleLabel()
        return title and image views. will always create them if necessary. always returns nil for system buttons
      • titleRectForContentRect

        public CGRect titleRectForContentRect​(CGRect contentRect)
      • titleShadowColorForState

        public UIColor titleShadowColorForState​(long state)
      • titleShadowOffset

        @Deprecated
        public CGSize titleShadowOffset()
        Deprecated.
      • currentPreferredSymbolConfiguration

        public UIImageSymbolConfiguration currentPreferredSymbolConfiguration()
        normal/highlighted/selected/disabled. can return nil
      • preferredSymbolConfigurationForImageInState

        public UIImageSymbolConfiguration preferredSymbolConfigurationForImageInState​(long state)
      • setPreferredSymbolConfigurationForImageInState

        public void setPreferredSymbolConfigurationForImageInState​(UIImageSymbolConfiguration configuration,
                                                                   long state)
      • systemButtonWithImageTargetAction

        public static java.lang.Object systemButtonWithImageTargetAction​(UIImage image,
                                                                         java.lang.Object target,
                                                                         org.moe.natj.objc.SEL action)
      • isPointerInteractionEnabled

        public boolean isPointerInteractionEnabled()
        Enables this button's built-in pointer interaction.
      • pointerStyleProvider

        public UIButton.Block_pointerStyleProvider_ret pointerStyleProvider()
        Called when the system pointer hovers over this button if its pointer interaction is enabled. The system calls this block with a proposed UIPointerEffect and UIPointerShape. You may use them to construct a customized version of the system provided style or return an entirely custom one.
      • setPointerInteractionEnabled

        public void setPointerInteractionEnabled​(boolean value)
        Enables this button's built-in pointer interaction.
      • setPointerStyleProvider

        public void setPointerStyleProvider​(UIButton.Block_setPointerStyleProvider value)
        Called when the system pointer hovers over this button if its pointer interaction is enabled. The system calls this block with a proposed UIPointerEffect and UIPointerShape. You may use them to construct a customized version of the system provided style or return an entirely custom one.
      • buttonWithTypePrimaryAction

        public static UIButton buttonWithTypePrimaryAction​(long buttonType,
                                                           UIAction primaryAction)
        Creates a button of the given type, registers primaryAction for the UIControlEventPrimaryActionTriggered control event, and if appropriate uses primaryAction's title & image as the button's title & image.
      • initWithFramePrimaryAction

        public UIButton initWithFramePrimaryAction​(CGRect frame,
                                                   UIAction primaryAction)
        Initializes a custom button, registers primaryAction for the UIControlEventPrimaryActionTriggered control event, and uses primaryAction's title & image as the button's title & image.
        Overrides:
        initWithFramePrimaryAction in class UIControl
      • menu

        public UIMenu menu()
        An optional menu for the button to display. The button will automatically enable or disable its contextMenuInteraction when a non-nil or nil menu is set. Defaults to nil.
      • role

        public long role()
        default is UIButtonRoleNormal.
      • setMenu

        public void setMenu​(UIMenu value)
        An optional menu for the button to display. The button will automatically enable or disable its contextMenuInteraction when a non-nil or nil menu is set. Defaults to nil.
      • setRole

        public void setRole​(long value)
        default is UIButtonRoleNormal.
      • systemButtonWithPrimaryAction

        public static java.lang.Object systemButtonWithPrimaryAction​(UIAction primaryAction)
        Creates a system button, registers primaryAction for the UIControlEventPrimaryActionTriggered control event, and uses primaryAction's title & image as the button's title & image.