<!--
{
  "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/PKStroke-swift.struct/substroke(range:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "PencilKit"
    ],
    "preciseIdentifier" : "s:9PencilKit8PKStrokeV9substroke5rangeACSNy14CoreFoundation7CGFloatVG_tF"
  },
  "title" : "substroke(range:)"
}
-->

# substroke(range:)

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

```
func substroke(range: ClosedRange<CGFloat>) -> 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 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.

---

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)