---
title: "substroke(with:)"
framework: pencilkit
role: symbol
role_heading: Instance Method
path: "pencilkit/pkstrokereference/substroke(with:)"
---

# substroke(with:)

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

## Declaration

```swift
func substroke(with range: __PKFloatRange) -> PKStroke
```

## Parameters

- `range`: The range of control points in the receiver to copy to the returned stroke.

## Return Value

Return Value A new stroke containing only the control points within the specified range.

## Discussion

Discussion Maintains rendering information so the returned substroke renders the same as the corresponding portion of the receiver. The returned stroke may have a renderState set to maintain this information.
