UIButton$Methods extension

on

Properties

adjustsImageWhenDisabled bool

Available on UIButton, provided by the UIButton$Methods extension

adjustsImageWhenDisabled
getter/setter pair
adjustsImageWhenHighlighted bool

Available on UIButton, provided by the UIButton$Methods extension

adjustsImageWhenHighlighted
getter/setter pair
automaticallyUpdatesConfiguration bool

Available on UIButton, provided by the UIButton$Methods extension

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.
getter/setter pair
buttonType UIButtonType

Available on UIButton, provided by the UIButton$Methods extension

buttonType
no setter
changesSelectionAsPrimaryAction bool

Available on UIButton, provided by the UIButton$Methods extension

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.
getter/setter pair
configuration UIButtonConfiguration?

Available on UIButton, provided by the UIButton$Methods extension

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.
getter/setter pair
configurationUpdateHandler ↔ ObjCBlock<Void Function(UIButton)>?

Available on UIButton, provided by the UIButton$Methods extension

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
getter/setter pair
contentEdgeInsets UIEdgeInsets

Available on UIButton, provided by the UIButton$Methods extension

contentEdgeInsets
getter/setter pair
currentAttributedTitle → NSAttributedString?

Available on UIButton, provided by the UIButton$Methods extension

currentAttributedTitle
no setter
currentBackgroundImage UIImage?

Available on UIButton, provided by the UIButton$Methods extension

currentBackgroundImage
no setter
currentImage UIImage?

Available on UIButton, provided by the UIButton$Methods extension

currentImage
no setter
currentPreferredSymbolConfiguration UIImageSymbolConfiguration?

Available on UIButton, provided by the UIButton$Methods extension

currentPreferredSymbolConfiguration
no setter
currentTitle → NSString?

Available on UIButton, provided by the UIButton$Methods extension

currentTitle
no setter
currentTitleColor UIColor

Available on UIButton, provided by the UIButton$Methods extension

currentTitleColor
no setter
currentTitleShadowColor UIColor?

Available on UIButton, provided by the UIButton$Methods extension

currentTitleShadowColor
no setter
font UIFont

Available on UIButton, provided by the UIButton$Methods extension

font
getter/setter pair
imageEdgeInsets UIEdgeInsets

Available on UIButton, provided by the UIButton$Methods extension

imageEdgeInsets
getter/setter pair
imageView UIImageView?

Available on UIButton, provided by the UIButton$Methods extension

imageView
no setter
isHeld bool

Available on UIButton, provided by the UIButton$Methods extension

Returns true while the button is presenting a menu.
no setter
isHovered bool

Available on UIButton, provided by the UIButton$Methods extension

If pointer effects are enabled for the button, this will return true when an effect is active.
no setter
isPointerInteractionEnabled bool

Available on UIButton, provided by the UIButton$Methods extension

Enables this button's built-in pointer interaction.
getter/setter pair
lineBreakMode NSLineBreakMode

Available on UIButton, provided by the UIButton$Methods extension

lineBreakMode
getter/setter pair

Available on UIButton, provided by the UIButton$Methods extension

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.
getter/setter pair
pointerStyleProvider ↔ ObjCBlock<UIPointerStyle? Function(UIButton, UIPointerEffect, UIPointerShape)>?

Available on UIButton, provided by the UIButton$Methods extension

! @abstract 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.
getter/setter pair
reversesTitleShadowWhenHighlighted bool

Available on UIButton, provided by the UIButton$Methods extension

reversesTitleShadowWhenHighlighted
getter/setter pair
role UIButtonRole

Available on UIButton, provided by the UIButton$Methods extension

role
getter/setter pair
showsTouchWhenHighlighted bool

Available on UIButton, provided by the UIButton$Methods extension

showsTouchWhenHighlighted
getter/setter pair
subtitleLabel UILabel?

Available on UIButton, provided by the UIButton$Methods extension

The label used to display the subtitle, when present.
no setter
tintColor UIColor

Available on UIButton, provided by the UIButton$Methods extension

tintColor
getter/setter pair
titleEdgeInsets UIEdgeInsets

Available on UIButton, provided by the UIButton$Methods extension

titleEdgeInsets
getter/setter pair
titleLabel UILabel?

Available on UIButton, provided by the UIButton$Methods extension

titleLabel
no setter
titleShadowOffset ↔ CGSize

Available on UIButton, provided by the UIButton$Methods extension

titleShadowOffset
getter/setter pair

Methods

attributedTitleForState(int state) → NSAttributedString?

Available on UIButton, provided by the UIButton$Methods extension

attributedTitleForState:
backgroundImageForState(int state) UIImage?

Available on UIButton, provided by the UIButton$Methods extension

backgroundImageForState:
backgroundRectForBounds(CGRect bounds) → CGRect

Available on UIButton, provided by the UIButton$Methods extension

backgroundRectForBounds:
contentRectForBounds(CGRect bounds) → CGRect

Available on UIButton, provided by the UIButton$Methods extension

contentRectForBounds:
encodeWithCoder(NSCoder coder) → void

Available on UIButton, provided by the UIButton$Methods extension

encodeWithCoder:
imageForState(int state) UIImage?

Available on UIButton, provided by the UIButton$Methods extension

imageForState:
imageRectForContentRect(CGRect contentRect) → CGRect

Available on UIButton, provided by the UIButton$Methods extension

imageRectForContentRect:
init() UIButton

Available on UIButton, provided by the UIButton$Methods extension

init
initWithCoder(NSCoder coder) UIButton?

Available on UIButton, provided by the UIButton$Methods extension

initWithCoder:
initWithFrame(CGRect frame) UIButton

Available on UIButton, provided by the UIButton$Methods extension

initWithFrame:
initWithFrame$1(CGRect frame, {UIAction? primaryAction}) UIButton

Available on UIButton, provided by the UIButton$Methods extension

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.
preferredSymbolConfigurationForImageInState(int state) UIImageSymbolConfiguration?

Available on UIButton, provided by the UIButton$Methods extension

preferredSymbolConfigurationForImageInState:
setAttributedTitle(NSAttributedString? title, {required int forState}) → void

Available on UIButton, provided by the UIButton$Methods extension

setAttributedTitle:forState:
setBackgroundImage(UIImage? image, {required int forState}) → void

Available on UIButton, provided by the UIButton$Methods extension

setBackgroundImage:forState:
setImage(UIImage? image, {required int forState}) → void

Available on UIButton, provided by the UIButton$Methods extension

setImage:forState:
setNeedsUpdateConfiguration() → void

Available on UIButton, provided by the UIButton$Methods extension

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.
setPreferredSymbolConfiguration(UIImageSymbolConfiguration? configuration, {required int forImageInState}) → void

Available on UIButton, provided by the UIButton$Methods extension

setPreferredSymbolConfiguration:forImageInState:
setTitle(NSString? title, {required int forState}) → void

Available on UIButton, provided by the UIButton$Methods extension

setTitle:forState:
setTitleColor(UIColor? color, {required int forState}) → void

Available on UIButton, provided by the UIButton$Methods extension

setTitleColor:forState:
setTitleShadowColor(UIColor? color, {required int forState}) → void

Available on UIButton, provided by the UIButton$Methods extension

setTitleShadowColor:forState:
titleColorForState(int state) UIColor?

Available on UIButton, provided by the UIButton$Methods extension

titleColorForState:
titleForState(int state) → NSString?

Available on UIButton, provided by the UIButton$Methods extension

titleForState:
titleRectForContentRect(CGRect contentRect) → CGRect

Available on UIButton, provided by the UIButton$Methods extension

titleRectForContentRect:
titleShadowColorForState(int state) UIColor?

Available on UIButton, provided by the UIButton$Methods extension

titleShadowColorForState:
updateConfiguration() → void

Available on UIButton, provided by the UIButton$Methods extension

Subclasses should override this method and update the button's configuration. This method should not be called directly, use setNeedsUpdateConfiguration to request an update.