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 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.

Instance Properties


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.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software