Instance Property

state

The state of the control, specified as a bitmask value.

Declaration

var state: UIControl.State { get }

Discussion

The value of this property is a bitmask of the constants in the UIControl.State type. A control can be in more than one state at a time. For example, it can be focused and highlighted at the same time. You can also get the values for individual states using the properties of this class.

See Also

Configuring the Control’s Attributes

var isEnabled: Bool

A Boolean value indicating whether the control is enabled.

var isSelected: Bool

A Boolean value indicating whether the control is in the selected state.

var isHighlighted: Bool

A Boolean value indicating whether the control draws a highlight.

var contentVerticalAlignment: UIControl.ContentVerticalAlignment

The vertical alignment of content within the control’s bounds.

enum UIControl.ContentVerticalAlignment

Constants for specifying the vertical alignment of content (text and images) in a control.

var contentHorizontalAlignment: UIControl.ContentHorizontalAlignment

The horizontal alignment of content within the control’s bounds.

var effectiveContentHorizontalAlignment: UIControl.ContentHorizontalAlignment

The horizontal alignment currently in effect for the control.

enum UIControl.ContentHorizontalAlignment

The horizontal alignment of content (text and images) within a control.