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

# scale(by:)

Applies the specified scaling factor along both x and y axes to the receiver’s transformation matrix.

## Declaration

```swift
func scale(by scale: Double)
```

## Parameters

- `scale`: The scaling factor to apply to both axes. Specifying a negative value has the effect of inverting the direction of the axes in addition to scaling them. A scaling factor of 1.0 scales the content to exactly the same size.

## Discussion

Discussion After invoking this method, applying the receiver’s matrix modifies the unit lengths along the current x and y axes by a factor of scale, in addition to performing all previous transformations.

## See Also

### Accumulating Transformations

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