---
title: "init(roundedRect:cornerRadius:)"
framework: uikit
role: symbol
role_heading: Initializer
path: "uikit/uibezierpath/init(roundedrect:cornerradius:)"
---

# init(roundedRect:cornerRadius:)

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

## Declaration

```swift
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

Return Value A new path object with the rounded rectangular path.

## Discussion

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.

## See Also

### Creating a Bézier path

- [init(rect:)](uikit/uibezierpath/init(rect:).md)
- [init(ovalIn:)](uikit/uibezierpath/init(ovalin:).md)
- [init(roundedRect:byRoundingCorners:cornerRadii:)](uikit/uibezierpath/init(roundedrect:byroundingcorners:cornerradii:).md)
- [init(arcCenter:radius:startAngle:endAngle:clockwise:)](uikit/uibezierpath/init(arccenter:radius:startangle:endangle:clockwise:).md)
- [init(cgPath:)](uikit/uibezierpath/init(cgpath:)-833n8.md)
- [reversing()](uikit/uibezierpath/reversing().md)
- [init()](uikit/uibezierpath/init().md)
- [init(coder:)](uikit/uibezierpath/init(coder:).md)
