---
title: "substroke(range:)"
framework: pencilkit
role: symbol
role_heading: Instance Method
path: "pencilkit/pkstroke-swift.struct/substroke(range:)"
---

# substroke(range:)

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

## Declaration

```swift
func substroke(range: ClosedRange<CGFloat>) -> PKStroke
```

## Parameters

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

## Mentioned in

Controlling stroke rendering for animation and editing

## Return Value

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

## Discussion

Discussion Maintains information for PencilKit rendering to make the copied part of the stroke render the same as the receiver. The returned stroke may have a renderState set to maintain this information.
