One Logo Pool Ball
RealityKit · IOS API REFERENCE

EntityTranslationGestureRecognizer

class · iOS 13.0+ · SDK 27.1

@MainActor @objc @preconcurrency class EntityTranslationGestureRecognizer

A gesture recognizer that uses a pan gesture to move an entity. A gesture recognizer that handles pan and dragging gestures on an entity.

Members (12)

method · iOS 13.0+

canPrevent

TypeScript
canPrevent(preventedGestureRecognizer: _UIKit_UIGestureRecognizer): Promise<boolean>
Swift declaration
@MainActor @preconcurrency override dynamic func canPrevent(_ preventedGestureRecognizer: UIGestureRecognizer) -> Bool
method · iOS 13.0+

reset

TypeScript
reset(): Promise<void>
Swift declaration
@MainActor @preconcurrency override dynamic func reset()

Overridden to reset internal state when a gesture recognition attempt completes.

method · iOS 13.0+

touchesBegan

TypeScript
touchesBegan(touches: Array<_UIKit_UITouch>, event: _UIKit_UIEvent): Promise<void>
Swift declaration
@MainActor @preconcurrency override dynamic func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent)

Sent to the gesture recognizer when one or more fingers touch down on the associated entity. - Parameters: - touches: A set of `UITouch` instances in the event represented by `event` that represent the touches in the `UITouch.Phase.began` phase. - event: A `UIEvent` object representing the event to which the touches belong.

method · iOS 13.0+

touchesCancelled

TypeScript
touchesCancelled(touches: Array<_UIKit_UITouch>, event: _UIKit_UIEvent): Promise<void>
Swift declaration
@MainActor @preconcurrency override dynamic func touchesCancelled(_ touches: Set<UITouch>, with event: UIEvent)

Sent to the gesture recognizer when a system event (such as an incoming phone call) cancels a touch event. - Parameters: - touches: A set of `UITouch` instances in the event represented by `event` that represent the touches in the `UITouch.Phase.cancelled` phase. - event: A `UIEvent` object representing the event to which the touches belong.

method · iOS 13.0+

touchesEnded

TypeScript
touchesEnded(touches: Array<_UIKit_UITouch>, event: _UIKit_UIEvent): Promise<void>
Swift declaration
@MainActor @preconcurrency override dynamic func touchesEnded(_ touches: Set<UITouch>, with event: UIEvent)

Sent to the gesture recognizer when one or more fingers lift from the associated view. - Parameters: - touches: A set of `UITouch` instances in the event represented by `event` that represent the touches in the `UITouch.Phase.ended` phase. - event: A `UIEvent` object representing the event to which the touches belong.

method · iOS 13.0+

touchesMoved

TypeScript
touchesMoved(touches: Array<_UIKit_UITouch>, event: _UIKit_UIEvent): Promise<void>
Swift declaration
@MainActor @preconcurrency override dynamic func touchesMoved(_ touches: Set<UITouch>, with event: UIEvent)

Sent to the gesture recognizer when one or more fingers move in the associated view. - Parameters: - touches: A set of `UITouch` instances in the event represented by `event` that represent the touches in the `UITouch.Phase.moved` phase. - event: A `UIEvent` object representing the event to which the touches belong.

method · iOS 13.0+

setTranslation

TypeScript
setTranslation(translation: SDKHandle, entity?: (_RealityFoundation_Entity) | null): Promise<void>
Swift declaration
@MainActor @preconcurrency func setTranslation(_ translation: SIMD3<Float>, in entity: Entity?)

Sets the translation of the receiver in the entity's coordinate space - Parameters: - translation: A point that identifies the new translation value. - entity: An entity in whose space the translation is to occur. A `nil` entity will result in world space.

method · iOS 13.0+

translation

TypeScript
translation(entity?: (_RealityFoundation_Entity) | null): Promise<(SDKHandle) | null>
Swift declaration
@MainActor @preconcurrency func translation(in entity: Entity?) -> SIMD3<Float>?

The translation of the gesture in the space of the specified entity. - Parameters: - entity: An entity in whose space the translation is computed. A `nil` entity will result in world space. - Returns: The 3D position identifying the translation of the gesture in the space specified. The x, y and z values report the total translation over time. They are not delta values from the last time that the translation was reported. Apply the translation value to the state of the entity when the gesture is first recognized -- do not concatenate the value each time the handler is called.

get · iOS 13.0+

entity

TypeScript
get entity(): Promise<(SDKHandle) | null>
Swift declaration
@MainActor @preconcurrency var entity: (any HasCollision)? { get set }

The entity the receiver is associated with

set · iOS 13.0+

entity

TypeScript
setEntity(value?: (Implements<_RealityFoundation_HasCollision> | SDKHandle) | null): Promise<void>
Swift declaration
@MainActor @preconcurrency var entity: (any HasCollision)? { get set }

The entity the receiver is associated with

method · iOS 13.0+

location

TypeScript
location(entity?: (_RealityFoundation_Entity) | null): Promise<(SDKHandle) | null>
Swift declaration
@MainActor @preconcurrency func location(in entity: Entity?) -> SIMD3<Float>?

Returns the unprojected location of the gesture represented by the receiver in the space of the given entity. - Parameters: - entity: An entity in whose space the location is computed. A `nil` entity will result in world space. - Returns: The 3D position identifying the location of the gesture in the space specified. The location is typically the result of a centroid of touches for a gesture, unprojected onto the associated `entity`, and then converted into the space of the entity passed in, or world space if `nil` is passed in.

method · iOS 13.0+

velocity

TypeScript
velocity(entity?: (_RealityFoundation_Entity) | null): Promise<SDKHandle>
Swift declaration
@MainActor @preconcurrency func velocity(in entity: Entity?) -> SIMD3<Float>

The velocity of the translation gesture in the space of the specified entity. - Parameters: - entity: The entity in whose space the velocity of the translation gesture is computed. A `nil` entity will result in world space. - Returns: The velocity of the translation gesture, in the space of the specified entity, in meters per second.

Skipped declarations

1 declarations were excluded from these bindings. Each reason comes from the generator or the iOS SDK compiler.

EntityTranslationGestureRecognizer.init(target:action:)

Objective-C selectors cannot cross the bridge.

All RealityKit types →