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 UIButton allocWithZone​(org.moe.natj.general.ptr.VoidPtr zone)
      • appearance

        @NotNull
        public static @NotNull UIButton appearance()
      • appearanceForTraitCollection

        @NotNull
        public static @NotNull UIButton appearanceForTraitCollection​(@NotNull
                                                                     @NotNull UITraitCollection trait)
      • appearanceForTraitCollectionWhenContainedIn

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

        @NotNull
        public static @NotNull UIButton appearanceForTraitCollectionWhenContainedInInstancesOfClasses​(@NotNull
                                                                                                      @NotNull UITraitCollection trait,
                                                                                                      @NotNull
                                                                                                      @NotNull NSArray<?> containerTypes)
      • appearanceWhenContainedIn

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

        @NotNull
        public static @NotNull UIButton appearanceWhenContainedInInstancesOfClasses​(@NotNull
                                                                                    @NotNull NSArray<?> containerTypes)
      • areAnimationsEnabled

        public static boolean areAnimationsEnabled()
      • automaticallyNotifiesObserversForKey

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

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

        public static UIButton buttonWithType​(long buttonType)
      • cancelPreviousPerformRequestsWithTarget

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

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

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

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

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

        @Deprecated
        public static void commitAnimations()
        Deprecated.
      • 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

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

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

        public static UIButton 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

        @Deprecated
        public static void setAnimationBeginsFromCurrentState​(boolean fromCurrentState)
        Deprecated.
      • setAnimationCurve

        @Deprecated
        public static void setAnimationCurve​(long curve)
        Deprecated.
      • setAnimationDelay

        @Deprecated
        public static void setAnimationDelay​(double delay)
        Deprecated.
      • setAnimationDelegate

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

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

        @Deprecated
        public static void setAnimationDuration_static​(double duration)
        Deprecated.
      • setAnimationRepeatAutoreverses

        @Deprecated
        public static void setAnimationRepeatAutoreverses​(boolean repeatAutoreverses)
        Deprecated.
      • setAnimationRepeatCount_static

        @Deprecated
        public static void setAnimationRepeatCount_static​(float repeatCount)
        Deprecated.
      • setAnimationStartDate

        @Deprecated
        public static void setAnimationStartDate​(@NotNull
                                                 @NotNull NSDate startDate)
        Deprecated.
      • setAnimationTransitionForViewCache

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

        @Deprecated
        public static void setAnimationWillStartSelector​(@Nullable
                                                         @Nullable org.moe.natj.objc.SEL selector)
        Deprecated.
      • 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

        @Deprecated
        public boolean adjustsImageWhenDisabled()
        Deprecated.
        default is YES. if YES, image is drawn lighter when disabled API-Since: 2.0 Deprecated-Since: 15.0 Deprecated-Message: This property is ignored when using UIButtonConfiguration, you may customize to replicate this behavior via a configurationUpdateHandler
      • adjustsImageWhenHighlighted

        @Deprecated
        public boolean adjustsImageWhenHighlighted()
        Deprecated.
        default is YES. if YES, image is drawn darker when highlighted(pressed) API-Since: 2.0 Deprecated-Since: 15.0 Deprecated-Message: This property is ignored when using UIButtonConfiguration, you may customize to replicate this behavior via a configurationUpdateHandler
      • _appearance

        @NotNull
        public @NotNull UIButton _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

        @NotNull
        @Deprecated
        public @NotNull UIButton _appearanceWhenContainedIn​(@Nullable
                                                            @Nullable 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. API-Since: 5.0 Deprecated-Since: 9.0
        Specified by:
        _appearanceWhenContainedIn in interface UIAppearance
        Overrides:
        _appearanceWhenContainedIn in class UIControl
      • attributedTitleForState

        @Nullable
        public @Nullable NSAttributedString attributedTitleForState​(long state)
        API-Since: 6.0
      • backgroundImageForState

        @Nullable
        public @Nullable UIImage backgroundImageForState​(long state)
      • backgroundRectForBounds

        @Deprecated
        public CGRect backgroundRectForBounds​(CGRect bounds)
        Deprecated.
        These methods will not be called when using a configuration. To change the layout of button content, override -layoutSubviews, call super, and then position views as you see fit. API-Since: 2.0 Deprecated-Since: 15.0 Deprecated-Message: Override layoutSubviews, call super, and position views as you desire.
      • buttonType

        public long buttonType()
      • contentEdgeInsets

        @Deprecated
        public UIEdgeInsets contentEdgeInsets()
        Deprecated.
        default is UIEdgeInsetsZero. On tvOS 10 or later, default is nonzero except for custom buttons. API-Since: 2.0 Deprecated-Since: 15.0 Deprecated-Message: This property is ignored when using UIButtonConfiguration
      • contentRectForBounds

        @Deprecated
        public CGRect contentRectForBounds​(CGRect bounds)
        Deprecated.
        API-Since: 2.0 Deprecated-Since: 15.0 Deprecated-Message: Override layoutSubviews, call super, and position views as you desire.
      • currentAttributedTitle

        @Nullable
        public @Nullable NSAttributedString currentAttributedTitle()
        normal/highlighted/selected/disabled. can return nil API-Since: 6.0
      • currentBackgroundImage

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

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

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

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

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

        @NotNull
        @Deprecated
        public @NotNull UIFont font()
        Deprecated.
        API-Since: 2.0 Deprecated-Since: 3.0 Deprecated-Message: Specify an attributed title with a custom font
      • imageEdgeInsets

        @Deprecated
        public UIEdgeInsets imageEdgeInsets()
        Deprecated.
        default is UIEdgeInsetsZero API-Since: 2.0 Deprecated-Since: 15.0 Deprecated-Message: This property is ignored when using UIButtonConfiguration
      • imageForState

        @Nullable
        public @Nullable UIImage imageForState​(long state)
      • imageRectForContentRect

        @Deprecated
        public CGRect imageRectForContentRect​(CGRect contentRect)
        Deprecated.
        API-Since: 2.0 Deprecated-Since: 15.0 Deprecated-Message: Override layoutSubviews, call super, and position views as you desire.
      • imageView

        @Nullable
        public @Nullable UIImageView imageView()
        API-Since: 3.0
      • lineBreakMode

        @Deprecated
        public long lineBreakMode()
        Deprecated.
        API-Since: 2.0 Deprecated-Since: 3.0 Deprecated-Message: Specify an attributed title with a customized paragraph style
      • reversesTitleShadowWhenHighlighted

        @Deprecated
        public boolean reversesTitleShadowWhenHighlighted()
        Deprecated.
        default is NO. if YES, shadow reverses to shift between engrave and emboss appearance API-Since: 2.0 Deprecated-Since: 15.0 Deprecated-Message: This property is ignored when using UIButtonConfiguration, you may customize to replicate this behavior via a configurationUpdateHandler
      • setAdjustsImageWhenDisabled

        @Deprecated
        public void setAdjustsImageWhenDisabled​(boolean value)
        Deprecated.
        default is YES. if YES, image is drawn lighter when disabled API-Since: 2.0 Deprecated-Since: 15.0 Deprecated-Message: This property is ignored when using UIButtonConfiguration, you may customize to replicate this behavior via a configurationUpdateHandler
      • setAdjustsImageWhenHighlighted

        @Deprecated
        public void setAdjustsImageWhenHighlighted​(boolean value)
        Deprecated.
        default is YES. if YES, image is drawn darker when highlighted(pressed) API-Since: 2.0 Deprecated-Since: 15.0 Deprecated-Message: This property is ignored when using UIButtonConfiguration, you may customize to replicate this behavior via a configurationUpdateHandler
      • setAttributedTitleForState

        public void setAttributedTitleForState​(@Nullable
                                               @Nullable NSAttributedString title,
                                               long state)
        default is nil. title is assumed to be single line API-Since: 6.0
      • setBackgroundImageForState

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

        @Deprecated
        public void setContentEdgeInsets​(UIEdgeInsets value)
        Deprecated.
        default is UIEdgeInsetsZero. On tvOS 10 or later, default is nonzero except for custom buttons. API-Since: 2.0 Deprecated-Since: 15.0 Deprecated-Message: This property is ignored when using UIButtonConfiguration
      • setFont

        @Deprecated
        public void setFont​(@NotNull
                            @NotNull UIFont value)
        Deprecated.
        API-Since: 2.0 Deprecated-Since: 3.0 Deprecated-Message: Specify an attributed title with a custom font
      • setImageForState

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

        @Deprecated
        public void setImageEdgeInsets​(UIEdgeInsets value)
        Deprecated.
        default is UIEdgeInsetsZero API-Since: 2.0 Deprecated-Since: 15.0 Deprecated-Message: This property is ignored when using UIButtonConfiguration
      • setLineBreakMode

        @Deprecated
        public void setLineBreakMode​(long value)
        Deprecated.
        API-Since: 2.0 Deprecated-Since: 3.0 Deprecated-Message: Specify an attributed title with a customized paragraph style
      • setReversesTitleShadowWhenHighlighted

        @Deprecated
        public void setReversesTitleShadowWhenHighlighted​(boolean value)
        Deprecated.
        default is NO. if YES, shadow reverses to shift between engrave and emboss appearance API-Since: 2.0 Deprecated-Since: 15.0 Deprecated-Message: This property is ignored when using UIButtonConfiguration, you may customize to replicate this behavior via a configurationUpdateHandler
      • setShowsTouchWhenHighlighted

        @Deprecated
        public void setShowsTouchWhenHighlighted​(boolean value)
        Deprecated.
        These properties are ignored when a configuration is set and have no replacement. API-Since: 2.0 Deprecated-Since: 15.0 Deprecated-Message: This property is ignored when using UIButtonConfiguration
      • setTintColor

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

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

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

        @Deprecated
        public void setTitleEdgeInsets​(UIEdgeInsets value)
        Deprecated.
        default is UIEdgeInsetsZero API-Since: 2.0 Deprecated-Since: 15.0 Deprecated-Message: This property is ignored when using UIButtonConfiguration
      • setTitleShadowColorForState

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

        @Deprecated
        public void setTitleShadowOffset​(CGSize value)
        Deprecated.
        API-Since: 2.0 Deprecated-Since: 3.0 Deprecated-Message: Specify an attributed title with a customized shadow style
      • showsTouchWhenHighlighted

        @Deprecated
        public boolean showsTouchWhenHighlighted()
        Deprecated.
        These properties are ignored when a configuration is set and have no replacement. API-Since: 2.0 Deprecated-Since: 15.0 Deprecated-Message: This property is ignored when using UIButtonConfiguration
      • tintColor

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

        @Nullable
        public @Nullable UIColor titleColorForState​(long state)
      • titleEdgeInsets

        @Deprecated
        public UIEdgeInsets titleEdgeInsets()
        Deprecated.
        default is UIEdgeInsetsZero API-Since: 2.0 Deprecated-Since: 15.0 Deprecated-Message: This property is ignored when using UIButtonConfiguration
      • titleForState

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

        @Nullable
        public @Nullable UILabel titleLabel()
        return title and image views. will always create them if necessary. always returns nil for system buttons API-Since: 3.0
      • titleRectForContentRect

        @Deprecated
        public CGRect titleRectForContentRect​(CGRect contentRect)
        Deprecated.
        API-Since: 2.0 Deprecated-Since: 15.0 Deprecated-Message: Override layoutSubviews, call super, and position views as you desire.
      • titleShadowColorForState

        @Nullable
        public @Nullable UIColor titleShadowColorForState​(long state)
      • titleShadowOffset

        @Deprecated
        public CGSize titleShadowOffset()
        Deprecated.
        API-Since: 2.0 Deprecated-Since: 3.0 Deprecated-Message: Specify an attributed title with a customized shadow style
      • currentPreferredSymbolConfiguration

        @Nullable
        public @Nullable UIImageSymbolConfiguration currentPreferredSymbolConfiguration()
        normal/highlighted/selected/disabled. can return nil API-Since: 13.0
      • preferredSymbolConfigurationForImageInState

        @Nullable
        public @Nullable UIImageSymbolConfiguration preferredSymbolConfigurationForImageInState​(long state)
        API-Since: 13.0
      • setPreferredSymbolConfigurationForImageInState

        public void setPreferredSymbolConfigurationForImageInState​(@Nullable
                                                                   @Nullable UIImageSymbolConfiguration configuration,
                                                                   long state)
        API-Since: 13.0
      • systemButtonWithImageTargetAction

        @NotNull
        public static @NotNull UIButton systemButtonWithImageTargetAction​(@NotNull
                                                                          @NotNull UIImage image,
                                                                          @Nullable
                                                                          @Nullable java.lang.Object target,
                                                                          @Nullable
                                                                          @Nullable org.moe.natj.objc.SEL action)
        API-Since: 13.0
      • isPointerInteractionEnabled

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

        @Nullable
        public @Nullable 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. Setting this property automatically enables the button's pointer interaction and sets @c pointerInteractionEnabled to true. API-Since: 13.4
      • setPointerInteractionEnabled

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

        public void setPointerStyleProvider​(@Nullable
                                            @Nullable 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. Setting this property automatically enables the button's pointer interaction and sets @c pointerInteractionEnabled to true. API-Since: 13.4
      • buttonWithTypePrimaryAction

        public static UIButton buttonWithTypePrimaryAction​(long buttonType,
                                                           @Nullable
                                                           @Nullable 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. API-Since: 14.0
      • initWithFramePrimaryAction

        public UIButton initWithFramePrimaryAction​(CGRect frame,
                                                   @Nullable
                                                   @Nullable 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. API-Since: 14.0
        Overrides:
        initWithFramePrimaryAction in class UIControl
      • menu

        @Nullable
        public @Nullable 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. API-Since: 14.0
      • role

        public long role()
        default is UIButtonRoleNormal. API-Since: 14.0
      • setMenu

        public void setMenu​(@Nullable
                            @Nullable 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. API-Since: 14.0
      • setRole

        public void setRole​(long value)
        default is UIButtonRoleNormal. API-Since: 14.0
      • systemButtonWithPrimaryAction

        @NotNull
        public static @NotNull UIButton systemButtonWithPrimaryAction​(@Nullable
                                                                      @Nullable 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. API-Since: 14.0
      • automaticallyUpdatesConfiguration

        public boolean automaticallyUpdatesConfiguration()
        When YES, the button will automatically call -updatedConfigurationForButton: on its `configuration ` when the button's state changes, and apply the updated configuration to the button. The default value is YES. API-Since: 15.0
      • behavioralStyle

        public long behavioralStyle()
        The button's behavioral style. This property always returns a concrete, resolved style (never UIBehavioralStyleAutomatic). API-Since: 15.0
      • buttonWithConfigurationPrimaryAction

        public static UIButton buttonWithConfigurationPrimaryAction​(@NotNull
                                                                    @NotNull UIButtonConfiguration configuration,
                                                                    @Nullable
                                                                    @Nullable UIAction primaryAction)
        Construct a new UIButton. `configuration` will be installed on the created button, and `primaryAction` added to handle the .primaryActionTriggered control event. If `primaryAction` has a title or image, they will be copied to `configuration` API-Since: 15.0
      • changesSelectionAsPrimaryAction

        public boolean changesSelectionAsPrimaryAction()
        Indicates if the button changes selection as its primary action. This shows the menu as options for selection if a menu is populated and showsMenuAsPrimaryAction is enabled. If no menu is provided or it is not the primary action, UIControlStateSelected is toggled on and off for the primary action. API-Since: 15.0
      • configuration

        @Nullable
        public @Nullable UIButtonConfiguration configuration()
        Setting a non-nil value for `configuration` will opt into configuration-based behavior on UIButton, update the button in a platform specific manner, and enable/disable some API. API-Since: 15.0
      • configurationUpdateHandler

        @Nullable
        public @Nullable UIButton.Block_configurationUpdateHandler_ret configurationUpdateHandler()
        Block-based equivalent to overriding -updateConfiguration in a subclass. Setting this handler will force the button into configuration-based behavior (see the `configuration` property). This block is called after `-updateConfiguration` API-Since: 15.0
      • isHeld

        public boolean isHeld()
        Returns true while the button is presenting a menu. API-Since: 15.0
      • isHovered

        public boolean isHovered()
        If pointer effects are enabled for the button, this will return true when an effect is active. API-Since: 15.0
      • preferredBehavioralStyle

        public long preferredBehavioralStyle()
        Request a style for the button. If the style changed, the button will redraw and its metrics may change. API-Since: 15.0
      • setAutomaticallyUpdatesConfiguration

        public void setAutomaticallyUpdatesConfiguration​(boolean value)
        When YES, the button will automatically call -updatedConfigurationForButton: on its `configuration ` when the button's state changes, and apply the updated configuration to the button. The default value is YES. API-Since: 15.0
      • setChangesSelectionAsPrimaryAction

        public void setChangesSelectionAsPrimaryAction​(boolean value)
        Indicates if the button changes selection as its primary action. This shows the menu as options for selection if a menu is populated and showsMenuAsPrimaryAction is enabled. If no menu is provided or it is not the primary action, UIControlStateSelected is toggled on and off for the primary action. API-Since: 15.0
      • setConfiguration

        public void setConfiguration​(@Nullable
                                     @Nullable UIButtonConfiguration value)
        Setting a non-nil value for `configuration` will opt into configuration-based behavior on UIButton, update the button in a platform specific manner, and enable/disable some API. API-Since: 15.0
      • setConfigurationUpdateHandler

        public void setConfigurationUpdateHandler​(@Nullable
                                                  @Nullable UIButton.Block_setConfigurationUpdateHandler value)
        Block-based equivalent to overriding -updateConfiguration in a subclass. Setting this handler will force the button into configuration-based behavior (see the `configuration` property). This block is called after `-updateConfiguration` API-Since: 15.0
      • setNeedsUpdateConfiguration

        public void setNeedsUpdateConfiguration()
        Requests the view update its configuration for its current state. This method is called automatically when the button's state may have changed, as well as in other circumstances where an update may be required. Multiple requests may be coalesced into a single update at the appropriate time. API-Since: 15.0
      • setPreferredBehavioralStyle

        public void setPreferredBehavioralStyle​(long value)
        Request a style for the button. If the style changed, the button will redraw and its metrics may change. API-Since: 15.0
      • subtitleLabel

        @Nullable
        public @Nullable UILabel subtitleLabel()
        The label used to display the subtitle, when present. API-Since: 15.0
      • updateConfiguration

        public void updateConfiguration()
        Subclasses should override this method and update the button's `configuration`. This method should not be called directly, use `setNeedsUpdateConfiguration` to request an update. API-Since: 15.0
      • preferredMenuElementOrder

        public long preferredMenuElementOrder()
        Preferred menu element ordering strategy for menus displayed by this button. API-Since: 16.0
      • setPreferredMenuElementOrder

        public void setPreferredMenuElementOrder​(long value)
        Preferred menu element ordering strategy for menus displayed by this button. API-Since: 16.0
      • useStoredAccessor

        @Deprecated
        public static boolean useStoredAccessor()
        Deprecated.