<!--
{
  "availability" : [
    "iOS: 3.2.0 -",
    "iPadOS: 3.2.0 -",
    "macCatalyst: 13.1.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIPanGestureRecognizer/setTranslation(_:in:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UIPanGestureRecognizer(im)setTranslation:inView:"
  },
  "title" : "setTranslation(_:in:)"
}
-->

# setTranslation(_:in:)

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

```
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

Changing the translation value resets the velocity of the pan.

---

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)