Contents

EntityTargetValue

A value containing an original gesture value along with a targeted entity.

Declaration

@dynamicMemberLookup struct EntityTargetValue<Value>

Overview

Spatial data from a location returned by a gesture can be converted to and from the entity using functions defined in RealityCoordinateSpaceConverting.

For example, here’s how to convert location from a DragGesture to the parent of an Entity:

DragGesture(coordinateSpace: .global).targetedToEntity().updating($state) { state, value, _ in
    let location = value.convert(
        value.location, from: .global, to: value.entity.parent
    )
    ...
}

Topics

Accessing gesture info

Instance Methods

See Also

Direct and indirect gestures