<!--
{
  "availability" : [
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -",
    "macCatalyst: 27.0.0 -",
    "macOS: 27.0.0 -",
    "visionOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "PencilKit",
  "identifier" : "/documentation/PencilKit/PKStrokeReference/substroke(with:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "PencilKit"
    ],
    "preciseIdentifier" : "c:objc(cs)PKStroke(im)substrokeWithRange:"
  },
  "title" : "substroke(with:)"
}
-->

# substroke(with:)

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

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

## Parameters

`range`

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

## Return Value

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

## 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.

---

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)