---
title: "prepend(_:)"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/nsaffinetransform/prepend(_:)"
---

# prepend(_:)

Prepends the specified matrix to the receiver’s matrix.

## Declaration

```swift
func prepend(_ transform: NSAffineTransform)
```

```swift
func prepend(_ transform: AffineTransform)
```

## Parameters

- `transform`: The matrix to prepend to the receiver.

## Discussion

Discussion This method multiplies the matrix in transform by the receiver’s matrix and replaces the receiver’s matrix with the result. This type of operation is the same as applying the transformations in transform followed by the transformations in the receiver.

## See Also

### Accumulating Transformations

- [rotate(byDegrees:)](foundation/nsaffinetransform/rotate(bydegrees:).md)
- [rotate(byRadians:)](foundation/nsaffinetransform/rotate(byradians:).md)
- [scale(by:)](foundation/nsaffinetransform/scale(by:).md)
- [scaleX(by:yBy:)](foundation/nsaffinetransform/scalex(by:yby:).md)
- [translateX(by:yBy:)](foundation/nsaffinetransform/translatex(by:yby:).md)
- [append(_:)](foundation/nsaffinetransform/append(_:).md)
- [invert()](foundation/nsaffinetransform/invert().md)
