An object that represents the presence or movement of a button press on the screen for a particular event.


class UIPress : NSObject


The press specifically encapsulates the pressing of some physically actuated button. All of the press types represent actual physical buttons on one of a variety of remotes. You access UIPress objects through UIEvent objects passed into responder objects for event handling. The gestureRecognizers property returns the gesture recognizers—that is, instances of a concrete subclass of UIGestureRecognizer—that are currently handling the given button press.


Getting a Press Object’s Gesture Recognizers

var force: CGFloat

The force of the button press.

var gestureRecognizers: [UIGestureRecognizer]?

The gesture recognizers that are receiving the press.

Responding to Press Events

Getting the Press’s Location

var window: UIWindow?

The window in which the press initially occurred.

Getting Press Attributes

var key: UIKey?

The key pressed or released on a physical keyboard.

var type: UIPress.PressType

The type of the specified press.

var phase: UIPress.Phase

The current press phase of the object.

var timestamp: TimeInterval

The time when the press occurred or when it was last mutated.


enum UIPress.Phase

The phases of a button press.

enum UIPress.PressType

The types of button presses.


Inherits From

Conforms To

See Also

Button Presses

class UIPressesEvent

An event that describes the state of a set of physical buttons that are available to the device, such as those on an associated remote or game controller.