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

# init(rect:)

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

```
convenience init(rect: CGRect)
```

## Parameters

`rect`

The rectangle describing the path to create.

## Return Value

A new path object with the rectangular path.

## Discussion

This method creates a closed subpath by starting at the origin of `rect` and adding line segments in a clockwise direction (relative to the default coordinate system).

---

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)