One Logo Pool Ball
UIKit · IOS API REFERENCE

UIControl

class · iOS 2.0+ · SDK 27.1

@MainActor class UIControl

Members (46)

method · iOS 2.0+

actions

TypeScript
actions(target: (unknown) | null, controlEvent: UIControl_Event): Promise<(Array<string>) | null>
Swift declaration
func actions(forTarget target: Any?, forControlEvent controlEvent: UIControl.Event) -> [String]?
method · iOS 14.0+

addAction

TypeScript
addAction(action: UIAction, controlEvents: UIControl_Event): Promise<void>
Swift declaration
func addAction(_ action: UIAction, for controlEvents: UIControl.Event)
method · iOS 2.0+

beginTracking

TypeScript
beginTracking(touch: UITouch, event?: (UIEvent) | null): Promise<boolean>
Swift declaration
func beginTracking(_ touch: UITouch, with event: UIEvent?) -> Bool
method · iOS 2.0+

cancelTracking

TypeScript
cancelTracking(event?: (UIEvent) | null): Promise<void>
Swift declaration
func cancelTracking(with event: UIEvent?)
method · iOS 14.0+

contextMenuInteraction

TypeScript
contextMenuInteractionConfigurationForMenuAtLocation(interaction: UIContextMenuInteraction, location: { x: number; y: number }): Promise<(UIContextMenuConfiguration) | null>
Swift declaration
func contextMenuInteraction(_ interaction: UIContextMenuInteraction, configurationForMenuAtLocation location: CGPoint) -> UIContextMenuConfiguration?
method · iOS 14.0+

contextMenuInteraction

TypeScript
contextMenuInteractionPreviewForDismissingMenuWithConfiguration(interaction: UIContextMenuInteraction, configuration: UIContextMenuConfiguration): Promise<(UITargetedPreview) | null>
Swift declaration
func contextMenuInteraction(_ interaction: UIContextMenuInteraction, previewForDismissingMenuWithConfiguration configuration: UIContextMenuConfiguration) -> UITargetedPreview?
method · iOS 14.0+

contextMenuInteraction

TypeScript
contextMenuInteractionPreviewForHighlightingMenuWithConfiguration(interaction: UIContextMenuInteraction, configuration: UIContextMenuConfiguration): Promise<(UITargetedPreview) | null>
Swift declaration
func contextMenuInteraction(_ interaction: UIContextMenuInteraction, previewForHighlightingMenuWithConfiguration configuration: UIContextMenuConfiguration) -> UITargetedPreview?
method · iOS 14.0+

contextMenuInteraction

TypeScript
contextMenuInteractionWillDisplayMenuForAnimator(interaction: UIContextMenuInteraction, configuration: UIContextMenuConfiguration, animator?: (SDKHandle) | null): Promise<void>
Swift declaration
func contextMenuInteraction(_ interaction: UIContextMenuInteraction, willDisplayMenuFor configuration: UIContextMenuConfiguration, animator: (any UIContextMenuInteractionAnimating)?)
method · iOS 14.0+

contextMenuInteraction

TypeScript
contextMenuInteractionWillEndForAnimator(interaction: UIContextMenuInteraction, configuration: UIContextMenuConfiguration, animator?: (SDKHandle) | null): Promise<void>
Swift declaration
func contextMenuInteraction(_ interaction: UIContextMenuInteraction, willEndFor configuration: UIContextMenuConfiguration, animator: (any UIContextMenuInteractionAnimating)?)
method · iOS 2.0+

continueTracking

TypeScript
continueTracking(touch: UITouch, event?: (UIEvent) | null): Promise<boolean>
Swift declaration
func continueTracking(_ touch: UITouch, with event: UIEvent?) -> Bool
method · iOS 2.0+

endTracking

TypeScript
endTracking(touch?: (UITouch) | null, event?: (UIEvent) | null): Promise<void>
Swift declaration
func endTracking(_ touch: UITouch?, with event: UIEvent?)
init · iOS 2.0+

init

TypeScript
static initCoder(coder: _Foundation_NSCoder): Promise<(UIControl) | null>
Swift declaration
init?(coder: NSCoder)
init · iOS 2.0+

init

TypeScript
static initFrame(frame: { x: number; y: number; width: number; height: number }): Promise<UIControl>
Swift declaration
init(frame: CGRect)
init · iOS 14.0+

init

TypeScript
static initFramePrimaryAction(frame: { x: number; y: number; width: number; height: number }, primaryAction?: (UIAction) | null): Promise<UIControl>
Swift declaration
convenience init(frame: CGRect, primaryAction: UIAction?)
method · iOS 14.0+

menuAttachmentPoint

TypeScript
menuAttachmentPoint(configuration: UIContextMenuConfiguration): Promise<{ x: number; y: number }>
Swift declaration
func menuAttachmentPoint(for configuration: UIContextMenuConfiguration) -> CGPoint
method · iOS 17.4+

performPrimaryAction

TypeScript
performPrimaryAction(): Promise<void>
Swift declaration
func performPrimaryAction()
method · iOS 14.0+

removeAction

TypeScript
removeActionFor(action: UIAction, controlEvents: UIControl_Event): Promise<void>
Swift declaration
func removeAction(_ action: UIAction, for controlEvents: UIControl.Event)
method · iOS 14.0+

removeAction

TypeScript
removeActionIdentifiedByFor(actionIdentifier: UIAction_Identifier, controlEvents: UIControl_Event): Promise<void>
Swift declaration
func removeAction(identifiedBy actionIdentifier: UIAction.Identifier, for controlEvents: UIControl.Event)
method · iOS 14.0+

sendAction

TypeScript
sendAction(action: UIAction): Promise<void>
Swift declaration
func sendAction(_ action: UIAction)
method · iOS 2.0+

sendActions

TypeScript
sendActions(controlEvents: UIControl_Event): Promise<void>
Swift declaration
func sendActions(for controlEvents: UIControl.Event)
get · iOS 2.0+

allControlEvents

TypeScript
get allControlEvents(): Promise<UIControl_Event>
Swift declaration
var allControlEvents: UIControl.Event { get }
get · iOS 2.0+

allTargets

TypeScript
get allTargets(): Promise<Array<unknown>>
Swift declaration
var allTargets: Set<AnyHashable> { get }
get · iOS 2.0+

contentHorizontalAlignment

TypeScript
get contentHorizontalAlignment(): Promise<UIControl_ContentHorizontalAlignment>
Swift declaration
var contentHorizontalAlignment: UIControl.ContentHorizontalAlignment { get set }
set · iOS 2.0+

contentHorizontalAlignment

TypeScript
setContentHorizontalAlignment(value: UIControl_ContentHorizontalAlignment): Promise<void>
Swift declaration
var contentHorizontalAlignment: UIControl.ContentHorizontalAlignment { get set }
get · iOS 2.0+

contentVerticalAlignment

TypeScript
get contentVerticalAlignment(): Promise<UIControl_ContentVerticalAlignment>
Swift declaration
var contentVerticalAlignment: UIControl.ContentVerticalAlignment { get set }
set · iOS 2.0+

contentVerticalAlignment

TypeScript
setContentVerticalAlignment(value: UIControl_ContentVerticalAlignment): Promise<void>
Swift declaration
var contentVerticalAlignment: UIControl.ContentVerticalAlignment { get set }
get · iOS 14.0+

contextMenuInteraction

TypeScript
get contextMenuInteraction(): Promise<(UIContextMenuInteraction) | null>
Swift declaration
var contextMenuInteraction: UIContextMenuInteraction? { get }
get · iOS 14.0+

isContextMenuInteractionEnabled

TypeScript
get isContextMenuInteractionEnabled(): Promise<boolean>
Swift declaration
var isContextMenuInteractionEnabled: Bool { get set }
set · iOS 14.0+

isContextMenuInteractionEnabled

TypeScript
setIsContextMenuInteractionEnabled(value: boolean): Promise<void>
Swift declaration
var isContextMenuInteractionEnabled: Bool { get set }
get · iOS 2.0+

effectiveContentHorizontalAlignment

TypeScript
get effectiveContentHorizontalAlignment(): Promise<UIControl_ContentHorizontalAlignment>
Swift declaration
var effectiveContentHorizontalAlignment: UIControl.ContentHorizontalAlignment { get }
get · iOS 2.0+

isEnabled

TypeScript
get isEnabled(): Promise<boolean>
Swift declaration
var isEnabled: Bool { get set }
set · iOS 2.0+

isEnabled

TypeScript
setIsEnabled(value: boolean): Promise<void>
Swift declaration
var isEnabled: Bool { get set }
get · iOS 2.0+

isHighlighted

TypeScript
get isHighlighted(): Promise<boolean>
Swift declaration
var isHighlighted: Bool { get set }
set · iOS 2.0+

isHighlighted

TypeScript
setIsHighlighted(value: boolean): Promise<void>
Swift declaration
var isHighlighted: Bool { get set }
get · iOS 2.0+

isSelected

TypeScript
get isSelected(): Promise<boolean>
Swift declaration
var isSelected: Bool { get set }
set · iOS 2.0+

isSelected

TypeScript
setIsSelected(value: boolean): Promise<void>
Swift declaration
var isSelected: Bool { get set }
get · iOS 14.0+

showsMenuAsPrimaryAction

TypeScript
get showsMenuAsPrimaryAction(): Promise<boolean>
Swift declaration
var showsMenuAsPrimaryAction: Bool { get set }
set · iOS 14.0+

showsMenuAsPrimaryAction

TypeScript
setShowsMenuAsPrimaryAction(value: boolean): Promise<void>
Swift declaration
var showsMenuAsPrimaryAction: Bool { get set }
get · iOS 2.0+

state

TypeScript
get state(): Promise<UIControl_State>
Swift declaration
var state: UIControl.State { get }
get · iOS 17.0+

isSymbolAnimationEnabled

TypeScript
get isSymbolAnimationEnabled(): Promise<boolean>
Swift declaration
var isSymbolAnimationEnabled: Bool { get set }
set · iOS 17.0+

isSymbolAnimationEnabled

TypeScript
setIsSymbolAnimationEnabled(value: boolean): Promise<void>
Swift declaration
var isSymbolAnimationEnabled: Bool { get set }
get · iOS 15.0+

toolTip

TypeScript
get toolTip(): Promise<(string) | null>
Swift declaration
var toolTip: String? { get set }
set · iOS 15.0+

toolTip

TypeScript
setToolTip(value?: (string) | null): Promise<void>
Swift declaration
var toolTip: String? { get set }
get · iOS 15.0+

toolTipInteraction

TypeScript
get toolTipInteraction(): Promise<(UIToolTipInteraction) | null>
Swift declaration
var toolTipInteraction: UIToolTipInteraction? { get }
get · iOS 2.0+

isTouchInside

TypeScript
get isTouchInside(): Promise<boolean>
Swift declaration
var isTouchInside: Bool { get }
get · iOS 2.0+

isTracking

TypeScript
get isTracking(): Promise<boolean>
Swift declaration
var isTracking: Bool { get }

Skipped declarations

5 declarations were excluded from these bindings. Each reason comes from the generator or the iOS SDK compiler.

UIControl.enumerateEventHandlers(_:)

Objective-C selectors cannot cross the bridge.

UIControl.addTarget(_:action:for:)

Objective-C selectors cannot cross the bridge.

UIControl.removeTarget(_:action:for:)

Objective-C selectors cannot cross the bridge.

UIControl.sendAction(_:to:for:)

Objective-C selectors cannot cross the bridge.

UIControl.init()

inherited init: cannot prove legal (class declares 2 custom initializers)

All UIKit types →