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

# size(_:)

Returns a new version of self representing the same shape, but that will ask it to create its path from a rect of size. This does not affect the layout properties of any views created from the shape (e.g. by filling it).

## Declaration

```swift
nonisolated func size(_ size: CGSize) -> some Shape

```

## See Also

### Transforming a shape

- [trim(from:to:)](swiftui/shape/trim(from:to:).md)
- [transform(_:)](swiftui/shape/transform(_:).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)
