Class

NSTouch

A snapshot of a particular touch at an instant in time.

Declaration

@interface NSTouch : NSObject

Overview

A touch event is not persistent throughout the touch, new instances are created as the touch progresses. The identity property is used to follow a specific touch across its lifetime.

Touches do not have a corresponding screen location. The first touch of a touch collection is latched to the view underlying the cursor using the same hit detection as mouse events. Additional touches on the same device are also latched to the same view as any other touching touches. A touch remains latched to its view until the touch has either ended or is cancelled.

Topics

Getting the Touch Type

Properties of this touch

identity

Use this property to track changes to a particular touch during the touch's life.

phase

The current phase of the touch.

NSTouchPhase

The possible phases of a touch. These constants are used by phase.

normalizedPosition

The normalized position of the touch.

resting

Returns whether the touch is a resting touch.

Properties of Touch Device

device

The digitizer that generated the touch. Useful to distinguish touches emanating from multiple-device scenario.

deviceSize

The range of the touch device in points (72ppi).

Relationships

Inherits From

Conforms To

See Also

Mouse, Keyboard, and Touch Events

NSEvent

An object that contains information about an input action such as a mouse click or a key press.