---
title: "transform(_:)"
framework: swiftui
role: symbol
role_heading: Instance Method
path: "swiftui/shape/transform(_:)"
---

# transform(_:)

Applies an affine transform to this shape.

## Declaration

```swift
nonisolated func transform(_ transform: CGAffineTransform) -> TransformedShape<Self>
```

## Parameters

- `transform`: The affine transformation matrix to apply to this shape.

## Return Value

Return Value A transformed shape, based on its matrix values.

## Discussion

Discussion Affine transforms present a mathematical approach to applying combinations of rotation, scaling, translation, and skew to shapes.

## See Also

### Transforming a shape

- [trim(from:to:)](swiftui/shape/trim(from:to:).md)
- [size(_:)](swiftui/shape/size(_:).md)
- [size(width:height:)](swiftui/shape/size(width:height:).md)
- [scale(_:anchor:)](swiftui/shape/scale(_:anchor:).md)
- [scale(x:y:anchor:)](swiftui/shape/scale(x:y:anchor:).md)
- [rotation(_:anchor:)](swiftui/shape/rotation(_:anchor:).md)
- [offset(_:)](swiftui/shape/offset(_:).md)
- [offset(x:y:)](swiftui/shape/offset(x:y:).md)
