---
title: "setTranslation(_:in:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/uipangesturerecognizer/settranslation(_:in:)"
---

# setTranslation(_:in:)

Sets the translation value in the coordinate system of the specified view.

## Declaration

```swift
func setTranslation(_ translation: CGPoint, in view: UIView?)
```

## Parameters

- `translation`: A point that identifies the new translation value.
- `view`: A view in whose coordinate system the translation is to occur.

## Discussion

Discussion Changing the translation value resets the velocity of the pan.

## See Also

### Tracking the location and velocity of the gesture

- [translation(in:)](uikit/uipangesturerecognizer/translation(in:).md)
- [velocity(in:)](uikit/uipangesturerecognizer/velocity(in:).md)
