<!--
{
  "availability" : [
    "macOS: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/NSGestureRecognizerRepresentableCoordinateSpaceConverter",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI56NSGestureRecognizerRepresentableCoordinateSpaceConverterV"
  },
  "title" : "NSGestureRecognizerRepresentableCoordinateSpaceConverter"
}
-->

# NSGestureRecognizerRepresentableCoordinateSpaceConverter

A structure used to convert locations to and from coordinate spaces in the
hierarchy of the SwiftUI view associated with an
[`NSGestureRecognizerRepresentable`](/documentation/SwiftUI/NSGestureRecognizerRepresentable).

```
struct NSGestureRecognizerRepresentableCoordinateSpaceConverter
```

## Topics

### Instance Properties

[`var localLocation: CGPoint`](/documentation/SwiftUI/NSGestureRecognizerRepresentableCoordinateSpaceConverter/localLocation)

The represented gesture recognizer’s current location in the coordinate
space of the SwiftUI view it’s attached to.

[`var localTranslation: CGPoint?`](/documentation/SwiftUI/NSGestureRecognizerRepresentableCoordinateSpaceConverter/localTranslation)

The represented gesture recognizer’s current translation in the
coordinate space of the SwiftUI view it’s attached to, or `nil` if the
represented gesture recognizer doesn’t respond to `-translationInView:`
selector.

[`var localVelocity: CGPoint?`](/documentation/SwiftUI/NSGestureRecognizerRepresentableCoordinateSpaceConverter/localVelocity)

The represented gesture recognizer’s current velocity in the
coordinate space of the SwiftUI view it’s attached to, or `nil` if the
represented gesture recognizer doesn’t respond to `-velocityInView:`
selector.

### Instance Methods

[`func convert(globalPoint: CGPoint, to: some CoordinateSpaceProtocol) -> CGPoint`](/documentation/SwiftUI/NSGestureRecognizerRepresentableCoordinateSpaceConverter/convert(globalPoint:to:))

Converts a point in the global coordinate space to a SwiftUI coordinate
space of an ancestor of the view the gesture recognizer is attached to.

[`func location(in: some CoordinateSpaceProtocol) -> CGPoint`](/documentation/SwiftUI/NSGestureRecognizerRepresentableCoordinateSpaceConverter/location(in:))

Converts the represented gesture recognizer’s current location to a
SwiftUI coordinate space of an ancestor of the view the gesture
recognizer is attached to.

[`func translation(in: some CoordinateSpaceProtocol) -> CGPoint?`](/documentation/SwiftUI/NSGestureRecognizerRepresentableCoordinateSpaceConverter/translation(in:))

Converts the represented gesture recognizer’s current translation to a
SwiftUI coordinate space of an ancestor of the view the gesture
recognizer is attached to.

[`func velocity(in: some CoordinateSpaceProtocol) -> CGPoint?`](/documentation/SwiftUI/NSGestureRecognizerRepresentableCoordinateSpaceConverter/velocity(in:))

Converts the represented gesture recognizer’s current velocity to a
SwiftUI coordinate space of an ancestor of the view the gesture
recognizer is attached to.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)