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

# UIBezierPath

A path that consists of straight and curved line segments that you can render in your custom views.

```
class UIBezierPath
```

## Overview

You use this class initially to specify just the geometry for your path. Paths can define simple shapes such as rectangles, ovals, and arcs or they can define complex polygons that incorporate a mixture of straight and curved line segments. After defining the shape, you can use additional methods of this class to render the path in the current drawing context.

A [`UIBezierPath`](/documentation/UIKit/UIBezierPath) object combines the geometry of a path with attributes that describe the path during rendering. You set the geometry and attributes separately and can change them independent of one another. After you have the object configured the way you want it, you can tell it to draw itself in the current context. Because the creation, configuration, and rendering process are all distinct steps, Bézier path objects can be reused easily in your code. You can even use the same object to render the same shape multiple times, perhaps changing the rendering options between successive drawing calls.

You set the geometry of a path by manipulating the path’s current point. When you create a new empty path object, the current point is undefined and must be set explicitly. To move the current point without drawing a segment, you use the [`move(to:)`](/documentation/UIKit/UIBezierPath/move(to:)) method. All other methods result in the addition of either a line or curve segments to the path. The methods for adding new segments always assume you are starting at the current point and ending at some new point that you specify. After adding the segment, the end point of the new segment automatically becomes the current point.

A single Bézier path object can contain any number of open or closed subpaths, where each subpath represents a connected series of path segments. Calling the [`close()`](/documentation/UIKit/UIBezierPath/close()) method closes a subpath by adding a straight line segment from the current point to the first point in the subpath. Calling the [`move(to:)`](/documentation/UIKit/UIBezierPath/move(to:)) method ends the current subpath (without closing it) and sets the starting point of the next subpath. The subpaths of a Bézier path object share the same drawing attributes and must be manipulated as a group. To draw subpaths with different attributes, you must put each subpath in its own [`UIBezierPath`](/documentation/UIKit/UIBezierPath) object.

After configuring the geometry and attributes of a Bézier path, you draw the path in the current graphics context using the [`stroke()`](/documentation/UIKit/UIBezierPath/stroke()) and [`fill()`](/documentation/UIKit/UIBezierPath/fill()) methods. The [`stroke()`](/documentation/UIKit/UIBezierPath/stroke()) method traces the outline of the path using the current stroke color and the attributes of the Bézier path object. Similarly, the [`fill()`](/documentation/UIKit/UIBezierPath/fill()) method fills in the area enclosed by the path using the current fill color. (You set the stroke and fill color using the [`UIColor`](/documentation/UIKit/UIColor) class.)

In addition to using a Bézier path object to draw shapes, you can also use it to define a new clipping region. The [`addClip()`](/documentation/UIKit/UIBezierPath/addClip()) method intersects the shape represented by the path object with the current clipping region of the graphics context. During subsequent drawing, only content that lies within the new intersection region is actually rendered to the graphics context.

## Topics

### Creating a Bézier path

[`bezierPath`](/documentation/UIKit/UIBezierPath/bezierPath)

Creates and returns a new Bézier path object.

[`init(rect:)`](/documentation/UIKit/UIBezierPath/init(rect:))

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

[`init(ovalIn:)`](/documentation/UIKit/UIBezierPath/init(ovalIn:))

Creates and returns a new Bézier path object with an inscribed oval path in the specified rectangle.

[`init(roundedRect:cornerRadius:)`](/documentation/UIKit/UIBezierPath/init(roundedRect:cornerRadius:))

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

[`init(roundedRect:byRoundingCorners:cornerRadii:)`](/documentation/UIKit/UIBezierPath/init(roundedRect:byRoundingCorners:cornerRadii:))

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

[`init(arcCenter:radius:startAngle:endAngle:clockwise:)`](/documentation/UIKit/UIBezierPath/init(arcCenter:radius:startAngle:endAngle:clockwise:))

Creates and returns a new Bézier path object with an arc of a circle.

[`init(cgPath:)`](/documentation/UIKit/UIBezierPath/init(cgPath:)-833n8)

Creates and returns a new Bézier path object with the contents of a Core Graphics path.

[`reversing()`](/documentation/UIKit/UIBezierPath/reversing())

Creates and returns a new Bézier path object with the reversed contents of the current path.

[`init()`](/documentation/UIKit/UIBezierPath/init())

Creates and returns an empty path object.

[`init(coder:)`](/documentation/UIKit/UIBezierPath/init(coder:))

Creates a Bézier path object from data in an unarchiver.

### Constructing a path

[`move(to:)`](/documentation/UIKit/UIBezierPath/move(to:))

Moves the path’s current point to the specified location.

[`addLine(to:)`](/documentation/UIKit/UIBezierPath/addLine(to:))

Appends a straight line to the path.

[`addArc(withCenter:radius:startAngle:endAngle:clockwise:)`](/documentation/UIKit/UIBezierPath/addArc(withCenter:radius:startAngle:endAngle:clockwise:))

Appends an arc to the path.

[`addCurve(to:controlPoint1:controlPoint2:)`](/documentation/UIKit/UIBezierPath/addCurve(to:controlPoint1:controlPoint2:))

Appends a cubic Bézier curve to the path.

[`addQuadCurve(to:controlPoint:)`](/documentation/UIKit/UIBezierPath/addQuadCurve(to:controlPoint:))

Appends a quadratic Bézier curve to the path.

[`close()`](/documentation/UIKit/UIBezierPath/close())

Closes the most recent subpath.

[`removeAllPoints()`](/documentation/UIKit/UIBezierPath/removeAllPoints())

Removes all points from the path, effectively deleting all subpaths.

[`append(_:)`](/documentation/UIKit/UIBezierPath/append(_:))

Appends the contents of the specified path object to the path.

[`cgPath`](/documentation/UIKit/UIBezierPath/cgPath)

The Core Graphics representation of the path.

[`currentPoint`](/documentation/UIKit/UIBezierPath/currentPoint)

The current point in the graphics path.

### Accessing drawing properties

[`lineWidth`](/documentation/UIKit/UIBezierPath/lineWidth)

The line width of the path.

[`lineCapStyle`](/documentation/UIKit/UIBezierPath/lineCapStyle)

The shape of the endpoints of a stroked path.

[`lineJoinStyle`](/documentation/UIKit/UIBezierPath/lineJoinStyle)

The shape of the joints between connected segments of a stroked path.

[`miterLimit`](/documentation/UIKit/UIBezierPath/miterLimit)

The limiting value that helps avoid spikes at junctions between connected line segments.

[`flatness`](/documentation/UIKit/UIBezierPath/flatness)

The factor that determines the rendering accuracy for curved path segments.

[`usesEvenOddFillRule`](/documentation/UIKit/UIBezierPath/usesEvenOddFillRule)

A Boolean value that indicates whether the even-odd winding rule is in use for drawing paths.

[`setLineDash(_:count:phase:)`](/documentation/UIKit/UIBezierPath/setLineDash(_:count:phase:))

Sets the line-stroking pattern for the path.

[`getLineDash(_:count:phase:)`](/documentation/UIKit/UIBezierPath/getLineDash(_:count:phase:))

Retrieves the line-stroking pattern for the path.

### Drawing paths

[`fill()`](/documentation/UIKit/UIBezierPath/fill())

Uses the current drawing properties to paint the region that the path encloses.

[`fill(with:alpha:)`](/documentation/UIKit/UIBezierPath/fill(with:alpha:))

Uses the specified blend mode and transparency values to paint the region that the path encloses.

[`stroke()`](/documentation/UIKit/UIBezierPath/stroke())

Draws a line along the path using the current drawing properties.

[`stroke(with:alpha:)`](/documentation/UIKit/UIBezierPath/stroke(with:alpha:))

Draws a line along the path using the specified blend mode and transparency values.

### Specifying clipping paths

[`addClip()`](/documentation/UIKit/UIBezierPath/addClip())

Uses the clipping path of the current graphics context to intersect the region that the path encloses, and makes the resulting shape the current clipping path.

### Performing hit-testing

[`contains(_:)`](/documentation/UIKit/UIBezierPath/contains(_:))

Returns a Boolean value that indicates whether the specified point is within the region that the path encloses.

[`isEmpty`](/documentation/UIKit/UIBezierPath/isEmpty)

A Boolean value that indicates whether the path has any valid elements.

[`bounds`](/documentation/UIKit/UIBezierPath/bounds)

The bounding rectangle of the path.

### Applying transformations

[`apply(_:)`](/documentation/UIKit/UIBezierPath/apply(_:))

Transforms all points in the path using the specified affine transform matrix.

### Constants

[`UIRectCorner`](/documentation/UIKit/UIRectCorner)

The corners of a rectangle.



---

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)