<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.15.0 -",
    "tvOS: 13.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 6.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/Path",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI4PathV"
  },
  "title" : "Path"
}
-->

# Path

The outline of a 2D shape.

```
@frozen struct Path
```

## Topics

### Creating a path

[`init()`](/documentation/SwiftUI/Path/init())

Creates an empty path.

[`init(_:)`](/documentation/SwiftUI/Path/init(_:))

Creates an empty path, then executes a closure to add its
initial elements.

[`init(ellipseIn:)`](/documentation/SwiftUI/Path/init(ellipseIn:))

Creates a path as an ellipse within the given rectangle.

[`init(roundedRect:cornerRadius:style:)`](/documentation/SwiftUI/Path/init(roundedRect:cornerRadius:style:))

Creates a path containing a rounded rectangle.

[`init(roundedRect:cornerSize:style:)`](/documentation/SwiftUI/Path/init(roundedRect:cornerSize:style:))

Creates a path containing a rounded rectangle.

[`init(roundedRect:cornerRadii:style:)`](/documentation/SwiftUI/Path/init(roundedRect:cornerRadii:style:))

Creates a path as the given rounded rectangle, which may have
uneven corner radii.

### Getting the path’s characteristics

[`boundingRect`](/documentation/SwiftUI/Path/boundingRect)

A rectangle containing all path segments.

[`cgPath`](/documentation/SwiftUI/Path/cgPath)

An immutable path representing the elements in the path.

[`contains(_:eoFill:)`](/documentation/SwiftUI/Path/contains(_:eoFill:))

Returns true if the path contains a specified point.

[`currentPoint`](/documentation/SwiftUI/Path/currentPoint)

Returns the last point in the path, or nil if the path contains
no points.

[`description`](/documentation/SwiftUI/Path/description)

A description of the path that may be used to recreate the path
via `init?(_:)`.

[`isEmpty`](/documentation/SwiftUI/Path/isEmpty)

A Boolean value indicating whether the path contains zero elements.

### Drawing a path

[`move(to:)`](/documentation/SwiftUI/Path/move(to:))

Begins a new subpath at the specified point.

[`addArc(center:radius:startAngle:endAngle:clockwise:transform:)`](/documentation/SwiftUI/Path/addArc(center:radius:startAngle:endAngle:clockwise:transform:))

Adds an arc of a circle to the path, specified with a radius
and angles.

[`addArc(tangent1End:tangent2End:radius:transform:)`](/documentation/SwiftUI/Path/addArc(tangent1End:tangent2End:radius:transform:))

Adds an arc of a circle to the path, specified with a radius
and two tangent lines.

[`addCurve(to:control1:control2:)`](/documentation/SwiftUI/Path/addCurve(to:control1:control2:))

Adds a cubic Bézier curve to the path, with the
specified end point and control points.

[`addEllipse(in:transform:)`](/documentation/SwiftUI/Path/addEllipse(in:transform:))

Adds an ellipse that fits inside the specified rectangle to the
path.

[`addLine(to:)`](/documentation/SwiftUI/Path/addLine(to:))

Appends a straight line segment from the current point to the
specified point.

[`addLines(_:)`](/documentation/SwiftUI/Path/addLines(_:))

Adds a sequence of connected straight-line segments to the path.

[`addPath(_:transform:)`](/documentation/SwiftUI/Path/addPath(_:transform:))

Appends another path value to this path.

[`addQuadCurve(to:control:)`](/documentation/SwiftUI/Path/addQuadCurve(to:control:))

Adds a quadratic Bézier curve to the path, with the
specified end point and control point.

[`addRect(_:transform:)`](/documentation/SwiftUI/Path/addRect(_:transform:))

Adds a rectangular subpath to the path.

[`addRects(_:transform:)`](/documentation/SwiftUI/Path/addRects(_:transform:))

Adds a set of rectangular subpaths to the path.

[`addRelativeArc(center:radius:startAngle:delta:transform:)`](/documentation/SwiftUI/Path/addRelativeArc(center:radius:startAngle:delta:transform:))

Adds an arc of a circle to the path, specified with a radius
and a difference in angle.

[`addRoundedRect(in:cornerSize:style:transform:)`](/documentation/SwiftUI/Path/addRoundedRect(in:cornerSize:style:transform:))

Adds a rounded rectangle to the path.

[`closeSubpath()`](/documentation/SwiftUI/Path/closeSubpath())

Closes and completes the current subpath.

### Transforming the path

[`applying(_:)`](/documentation/SwiftUI/Path/applying(_:))

Returns a path constructed by applying the transform to all
points of the path.

[`offsetBy(dx:dy:)`](/documentation/SwiftUI/Path/offsetBy(dx:dy:))

Returns a path constructed by translating all its points.

[`trimmedPath(from:to:)`](/documentation/SwiftUI/Path/trimmedPath(from:to:))

Returns a partial copy of the path.

### Performing operations on the path

[`addRoundedRect(in:cornerSize:style:transform:)`](/documentation/SwiftUI/Path/addRoundedRect(in:cornerSize:style:transform:))

Adds a rounded rectangle to the path.

[`intersection(_:eoFill:)`](/documentation/SwiftUI/Path/intersection(_:eoFill:))

Returns a new path with filled regions common to both paths.

[`lineIntersection(_:eoFill:)`](/documentation/SwiftUI/Path/lineIntersection(_:eoFill:))

Returns a new path with a line from this path that overlaps the
filled regions of the given path.

[`lineSubtraction(_:eoFill:)`](/documentation/SwiftUI/Path/lineSubtraction(_:eoFill:))

Returns a new path with a line from this path that does not
overlap the filled region of the given path.

[`normalized(eoFill:)`](/documentation/SwiftUI/Path/normalized(eoFill:))

Returns a new weakly-simple copy of this path.

[`subtracting(_:eoFill:)`](/documentation/SwiftUI/Path/subtracting(_:eoFill:))

Returns a new path with filled regions from this path that are
not in the given path.

[`symmetricDifference(_:eoFill:)`](/documentation/SwiftUI/Path/symmetricDifference(_:eoFill:))

Returns a new path with filled regions either from this path or
the given path, but not in both.

[`union(_:eoFill:)`](/documentation/SwiftUI/Path/union(_:eoFill:))

Returns a new path with filled regions in either this path or
the given path.

### Operating over path elements

[`forEach(_:)`](/documentation/SwiftUI/Path/forEach(_:))

Calls `body` with each element in the path.

[`Path.Element`](/documentation/SwiftUI/Path/Element)

An element of a path.

### Applying a style

[`strokedPath(_:)`](/documentation/SwiftUI/Path/strokedPath(_:))

Returns a stroked copy of the path using `style` to define how the
stroked outline is created.



---

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)