---
title: cgPath
framework: uikit
role: symbol
role_heading: Instance Property
path: uikit/uibezierpath/cgpath
---

# cgPath

The Core Graphics representation of the path.

## Declaration

```swift
var cgPath: CGPath { get set }
```

## Discussion

Discussion This property contains a snapshot of the path at any given point in time. Getting this property returns an immutable path object that you can pass to Core Graphics functions. The path object itself is owned by the UIBezierPath object and is valid only until you make further modifications to the path. You can set the value of this property to a path you built using the functions of the Core Graphics framework. When setting a new path, this method makes a copy of the path you provide.

## See Also

### Constructing a path

- [move(to:)](uikit/uibezierpath/move(to:).md)
- [addLine(to:)](uikit/uibezierpath/addline(to:).md)
- [addArc(withCenter:radius:startAngle:endAngle:clockwise:)](uikit/uibezierpath/addarc(withcenter:radius:startangle:endangle:clockwise:).md)
- [addCurve(to:controlPoint1:controlPoint2:)](uikit/uibezierpath/addcurve(to:controlpoint1:controlpoint2:).md)
- [addQuadCurve(to:controlPoint:)](uikit/uibezierpath/addquadcurve(to:controlpoint:).md)
- [close()](uikit/uibezierpath/close().md)
- [removeAllPoints()](uikit/uibezierpath/removeallpoints().md)
- [append(_:)](uikit/uibezierpath/append(_:).md)
- [currentPoint](uikit/uibezierpath/currentpoint.md)
