<!--
{
  "availability" : [
    "iOS: 14.0.0 -",
    "iPadOS: 14.0.0 -",
    "macCatalyst: 14.0.0 -",
    "macOS: 11.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "PencilKit",
  "identifier" : "/documentation/PencilKit/PKStrokePathReference",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "PencilKit"
    ],
    "preciseIdentifier" : "c:objc(cs)PKStrokePath"
  },
  "title" : "PKStrokePathReference"
}
-->

# PKStrokePathReference

A class that captures the components of a stroke and provides methods to find and interpolate points along the stroke’s path.

```
class PKStrokePathReference
```

## Topics

### Creating a new stroke path

[`init(controlPoints: [PKStrokePoint], creationDate: Date)`](/documentation/PencilKit/PKStrokePathReference/init(controlPoints:creationDate:))

Creates a stroke path with the cubic B-spline control points and a date that you specify.

### Getting the stroke path properties

[`var count: Int`](/documentation/PencilKit/PKStrokePathReference/count)

The number of control points in this stroke path.

[`var creationDate: Date`](/documentation/PencilKit/PKStrokePathReference/creationDate)

The time at which this stroke path starts.

### Accessing and interpolating points

[`func enumerateInterpolatedPoints(in: __PKFloatRange, strideByDistance: CGFloat, using: (PKStrokePoint, UnsafeMutablePointer<ObjCBool>) -> Void)`](/documentation/PencilKit/PKStrokePathReference/enumerateInterpolatedPoints(in:strideByDistance:using:))

Executes a given block using each point in a range with a distance step.

[`func enumerateInterpolatedPoints(in: __PKFloatRange, strideByParametricStep: CGFloat, using: (PKStrokePoint, UnsafeMutablePointer<ObjCBool>) -> Void)`](/documentation/PencilKit/PKStrokePathReference/enumerateInterpolatedPoints(in:strideByParametricStep:using:))

Executes a given block using each point in a range with a parametric step.

[`func enumerateInterpolatedPoints(in: __PKFloatRange, strideByTime: TimeInterval, using: (PKStrokePoint, UnsafeMutablePointer<ObjCBool>) -> Void)`](/documentation/PencilKit/PKStrokePathReference/enumerateInterpolatedPoints(in:strideByTime:using:))

Executes a given block using each point in a range with a time step.

[`func interpolatedLocation(at: CGFloat) -> CGPoint`](/documentation/PencilKit/PKStrokePathReference/interpolatedLocation(at:))

Returns the on-curve point for the floating point parametric value.

[`func interpolatedPoint(at: CGFloat) -> PKStrokePoint`](/documentation/PencilKit/PKStrokePathReference/interpolatedPoint(at:))

Returns the on-curve point for the provided floating point parameter.

[`func parametricValue(CGFloat, offsetByDistance: CGFloat) -> CGFloat`](/documentation/PencilKit/PKStrokePathReference/parametricValue(_:offsetByDistance:))

Returns a parametric value on the B-spline that’s a specified distance from the given parametric value.

[`func parametricValue(CGFloat, offsetByTime: TimeInterval) -> CGFloat`](/documentation/PencilKit/PKStrokePathReference/parametricValue(_:offsetByTime:))

Returns a parametric value on the B-spline that’s a specified time from the given parametric value.

[`func point(at: Int) -> PKStrokePoint`](/documentation/PencilKit/PKStrokePathReference/point(at:))

Returns the B-spline control point at an index point that you provide.

[`subscript(Int) -> PKStrokePoint`](/documentation/PencilKit/PKStrokePathReference/subscript(_:))

Returns the B-spline control point the location index that you provide.

### Initializers

[`convenience init(bezierPath: CGPath, creationDate: Date, pointProvider: (PKConvertedBezierPointReference) -> PKStrokePoint)`](/documentation/PencilKit/PKStrokePathReference/init(bezierPath:creationDate:pointProvider:))

Creates a stroke path recreating the specified Bézier path as a cubic uniform B-Spline.

[`convenience init(controlPoints: [PKStrokePoint], creationDate: Date, strokePathID: UUID)`](/documentation/PencilKit/PKStrokePathReference/init(controlPoints:creationDate:strokePathID:))

Creates a stroke path with the specified control points and a unique identifier.

### Instance Properties

[`var bezierRepresentation: CGPath`](/documentation/PencilKit/PKStrokePathReference/bezierRepresentation)

A Bézier path representation of the path’s curve, computed in linear time.

[`var strokePathID: UUID`](/documentation/PencilKit/PKStrokePathReference/strokePathID)

The unique identity of the stroke path.

### Instance Methods

[`func subpath(with: __PKFloatRange) -> PKStrokePath`](/documentation/PencilKit/PKStrokePathReference/subpath(with:))

Returns a copy of the path containing the control points in the specified parametric range.

## Relationships

### Inherits From

[`NSObject-swift.class`](/documentation/ObjectiveC/NSObject-swift.class)

### Conforms To

[`Hashable`](/documentation/Swift/Hashable)

[`CVarArg`](/documentation/Swift/CVarArg)

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`NSCopying`](/documentation/Foundation/NSCopying)

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

[`Equatable`](/documentation/Swift/Equatable)

[`Sendable`](/documentation/Swift/Sendable)

---

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)