<!--
{
  "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:byRoundingCorners:cornerRadii:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UIBezierPath(cm)bezierPathWithRoundedRect:byRoundingCorners:cornerRadii:"
  },
  "title" : "init(roundedRect:byRoundingCorners:cornerRadii:)"
}
-->

# init(roundedRect:byRoundingCorners:cornerRadii:)

Creates and returns a new Bézier path object with a rectangular path rounded at the specified corners.

```
convenience init(roundedRect rect: CGRect, byRoundingCorners corners: UIRectCorner, cornerRadii: CGSize)
```

## Parameters

`rect`

The rectangle that defines the basic shape of the path.

`corners`

A bitmask value that identifies the corners that you want rounded. You can use this parameter to round only a subset of the corners of the rectangle.

`cornerRadii`

The radius of each corner oval. 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)