One Logo Pool Ball
SwiftUI · IOS API REFERENCE

SpatialEventCollection.Event

struct · iOS 18.0+ · SDK 27.1

struct Event

A spatial event generated from an input like a touch or click that can drive gestures in the system. You receive a collection of these events in the form of a ``SpatialEventCollection`` that's the input to the ``Gesture/onChanged(_:)`` or ``Gesture/onEnded(_:)`` method of a ``SpatialEventGesture``. Inspect individual events to track interactions that enable you to create complex, multi-touch experiences in your app.

Members (14)

get · iOS 18.0+

modifierKeys

TypeScript
get modifierKeys(): _SwiftUICore_EventModifiers
Swift declaration
var modifierKeys: EventModifiers

The set of active modifier keys at the time of this event.

set · iOS 18.0+

modifierKeys

TypeScript
set modifierKeys(value: _SwiftUICore_EventModifiers)
Swift declaration
var modifierKeys: EventModifiers

The set of active modifier keys at the time of this event.

get · iOS 18.0+

inputDevicePose

TypeScript
get inputDevicePose(): (SpatialEventCollection_Event_InputDevicePose) | null
Swift declaration
var inputDevicePose: SpatialEventCollection.Event.InputDevicePose? { get set }

The 3D position and orientation of the device controlling the touch, if one exists.

set · iOS 18.0+

inputDevicePose

TypeScript
set inputDevicePose(value: (SpatialEventCollection_Event_InputDevicePose) | null)
Swift declaration
var inputDevicePose: SpatialEventCollection.Event.InputDevicePose? { get set }

The 3D position and orientation of the device controlling the touch, if one exists.

get · iOS 18.0+

id

TypeScript
get id(): SpatialEventCollection_Event_ID
Swift declaration
var id: SpatialEventCollection.Event.ID

An identifier that uniquely identifies the event over its lifetime.

set · iOS 18.0+

id

TypeScript
set id(value: SpatialEventCollection_Event_ID)
Swift declaration
var id: SpatialEventCollection.Event.ID

An identifier that uniquely identifies the event over its lifetime.

get · iOS 18.0+

kind

TypeScript
get kind(): SpatialEventCollection_Event_Kind
Swift declaration
var kind: SpatialEventCollection.Event.Kind

The event's input source.

set · iOS 18.0+

kind

TypeScript
set kind(value: SpatialEventCollection_Event_Kind)
Swift declaration
var kind: SpatialEventCollection.Event.Kind

The event's input source.

get · iOS 18.0+

phase

TypeScript
get phase(): SpatialEventCollection_Event_Phase
Swift declaration
var phase: SpatialEventCollection.Event.Phase

The phase of the event.

set · iOS 18.0+

phase

TypeScript
set phase(value: SpatialEventCollection_Event_Phase)
Swift declaration
var phase: SpatialEventCollection.Event.Phase

The phase of the event.

get · iOS 18.0+

location

TypeScript
get location(): { x: number; y: number }
Swift declaration
var location: CGPoint

The 2D location of the event.

set · iOS 18.0+

location

TypeScript
set location(value: { x: number; y: number })
Swift declaration
var location: CGPoint

The 2D location of the event.

get · iOS 18.0+

timestamp

TypeScript
get timestamp(): number
Swift declaration
var timestamp: TimeInterval

The time the event was processed.

set · iOS 18.0+

timestamp

TypeScript
set timestamp(value: number)
Swift declaration
var timestamp: TimeInterval

The time the event was processed.

Skipped declarations

No declarations were skipped in this snapshot.

All SwiftUI types →