---
title: "translation(in:)"
framework: swiftui
role: symbol
role_heading: Instance Method
path: "swiftui/uigesturerecognizerrepresentablecoordinatespaceconverter/translation(in:)"
---

# 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.

## Declaration

```swift
func translation(in coordinateSpace: some CoordinateSpaceProtocol) -> CGPoint?
```

## Parameters

- `coordinateSpace`: The SwiftUI coordinate space to convert to.

## Discussion

Discussion If the gesture recognizer does not implement a translationInView: method, returns nil.
