<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.15.0 -",
    "tvOS: 13.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 6.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/Path/init(roundedRect:cornerSize:style:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI4PathV11roundedRect10cornerSize5styleACSo6CGRectV_So6CGSizeVAA18RoundedCornerStyleOtcfc"
  },
  "title" : "init(roundedRect:cornerSize:style:)"
}
-->

# init(roundedRect:cornerSize:style:)

Creates a path containing a rounded rectangle.

```
init(roundedRect rect: CGRect, cornerSize: CGSize, style: RoundedCornerStyle = .continuous)
```

## Parameters

`rect`

A rectangle, specified in user space coordinates.

`cornerSize`

The size of the corners, specified in user space
coordinates.

`style`

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

## Discussion

This is a convenience function that creates a path of a rounded
rectangle. Using this convenience function is more efficient
than creating a path and adding a rounded rectangle to it.

---

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)