<!--
{
  "availability" : [
    "iOS: 16.0.0 -",
    "iPadOS: 16.0.0 -",
    "macCatalyst: 16.0.0 -",
    "macOS: 13.0.0 -",
    "tvOS: 16.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 9.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/Path/addRoundedRect(in:cornerRadii:style:transform:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI4PathV14addRoundedRect2in11cornerRadii5style9transformySo6CGRectV_AA015RectangleCornerI0VAA0eN5StyleOSo17CGAffineTransformVtF"
  },
  "title" : "addRoundedRect(in:cornerRadii:style:transform:)"
}
-->

# addRoundedRect(in:cornerRadii:style:transform:)

Adds a rounded rectangle with uneven corners to the path.

```
mutating func addRoundedRect(in rect: CGRect, cornerRadii: RectangleCornerRadii, style: RoundedCornerStyle = .continuous, transform: CGAffineTransform = .identity)
```

## Parameters

`rect`

A rectangle, specified in user space coordinates.

`cornerRadii`

The radius of each corner of the rectangle,
specified in user space coordinates.

`style`

The corner style. Defaults to the `continous` style
if not specified.

`transform`

An affine transform to apply to the rectangle
before adding to the path. Defaults to the identity
transform if not specified.

## Discussion

This is a convenience function that adds a rounded rectangle to
a path, starting by moving to the center of the right edge and
then adding lines and curves counter-clockwise to create a
rounded rectangle, closing the subpath.

---

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)