<!--
{
  "availability" : [
    "iOS: 3.2.0 -",
    "iPadOS: 3.2.0 -",
    "macCatalyst: 13.1.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIBezierPath/init(roundedRect:cornerRadius:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UIBezierPath(cm)bezierPathWithRoundedRect:cornerRadius:"
  },
  "title" : "init(roundedRect:cornerRadius:)"
}
-->

# init(roundedRect:cornerRadius:)

Creates and returns a new Bézier path object with a rounded rectangular path.

```
convenience init(roundedRect rect: CGRect, cornerRadius: CGFloat)
```

## Parameters

`rect`

The rectangle that defines the basic shape of the path.

`cornerRadius`

The radius of each corner oval. A value of `0` results in a rectangle without rounded corners. Values larger than half the rectangle’s width or height are clamped appropriately to half the width or height.

## Return Value

A new path object with the rounded rectangular path.

## Discussion

This method creates a closed subpath, proceeding in a clockwise direction (relative to the default coordinate system) as it creates the necessary line and curve segments.

---

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)