<!--
{
  "availability" : [
    "macCatalyst: 13.0.0 -",
    "macOS: 10.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/NSAffineTransform/translateX(by:yBy:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(cs)NSAffineTransform(im)translateXBy:yBy:"
  },
  "title" : "translateX(by:yBy:)"
}
-->

# translateX(by:yBy:)

Applies the specified translation factors to the receiver’s transformation matrix.

```
func translateX(by deltaX: Double, yBy deltaY: Double)
```

## Parameters

`deltaX`

The number of units to move along the x axis.

`deltaY`

The number of units to move along the y axis.

## Discussion

Subsequent transformations cause coordinates to be shifted by `deltaX` units along the x axis and by `deltaY` units along the y axis. Translation factors do not affect `NSSize` values, which specify a differential between points.

---

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)