---
title: PKStroke
framework: pencilkit
role: symbol
role_heading: Structure
path: pencilkit/pkstroke-swift.struct
---

# PKStroke

A structure that represents the paths, boundaries, and other properties of a stroke drawn on a canvas.

## Declaration

```swift
struct PKStroke
```

## Mentioned in

Supporting backward compatibility for ink types

## Topics

### Creating a stroke object

- [init(ink:path:transform:mask:)](pencilkit/pkstroke-swift.struct/init(ink:path:transform:mask:)-1imp6.md)
- [init(ink:path:transform:mask:)](pencilkit/pkstroke-swift.struct/init(ink:path:transform:mask:)-w7ti.md)
- [init(ink:path:transform:mask:randomSeed:)](pencilkit/pkstroke-swift.struct/init(ink:path:transform:mask:randomseed:)-10m5j.md)
- [init(ink:path:transform:mask:randomSeed:)](pencilkit/pkstroke-swift.struct/init(ink:path:transform:mask:randomseed:)-epus.md)

### Getting the stroke properties

- [ink](pencilkit/pkstroke-swift.struct/ink.md)
- [mask](pencilkit/pkstroke-swift.struct/mask-8g6sx.md)
- [mask](pencilkit/pkstroke-swift.struct/mask-16kkz.md)
- [maskedPathRanges](pencilkit/pkstroke-swift.struct/maskedpathranges.md)
- [path](pencilkit/pkstroke-swift.struct/path.md)
- [renderBounds](pencilkit/pkstroke-swift.struct/renderbounds.md)
- [transform](pencilkit/pkstroke-swift.struct/transform.md)
- [randomSeed](pencilkit/pkstroke-swift.struct/randomseed.md)

### Identifying the stroke

- [id](pencilkit/pkstroke-swift.struct/id.md)

### Manipulating strokes

- [substroke(range:)](pencilkit/pkstroke-swift.struct/substroke(range:).md)

### Configuring rendering

- [renderGroupID](pencilkit/pkstroke-swift.struct/rendergroupid.md)
- [renderState](pencilkit/pkstroke-swift.struct/renderstate-swift.property.md)
- [PKStroke.RenderState](pencilkit/pkstroke-swift.struct/renderstate-swift.struct.md)

### Supporting backward compatibility

- [requiredContentVersion](pencilkit/pkstroke-swift.struct/requiredcontentversion.md)

### Using reference types

- [PKStrokeReference](pencilkit/pkstrokereference.md)

### Initializers

- [init(ink:path:transform:mask:randomSeed:id:renderGroupID:renderState:)](pencilkit/pkstroke-swift.struct/init(ink:path:transform:mask:randomseed:id:rendergroupid:renderstate:)-1qvj7.md)
- [init(ink:path:transform:mask:randomSeed:id:renderGroupID:renderState:)](pencilkit/pkstroke-swift.struct/init(ink:path:transform:mask:randomseed:id:rendergroupid:renderstate:)-idqu.md)

### Default Implementations

- [Identifiable Implementations](pencilkit/pkstroke-swift.struct/identifiable-implementations.md)

## Relationships

### Conforms To

- [Copyable](swift/copyable.md)
- [Escapable](swift/escapable.md)
- [Identifiable](swift/identifiable.md)
- [Markup](paperkit/markup.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Canvas

- [Drawing with PencilKit](pencilkit/drawing-with-pencilkit.md)
- [Customizing Scribble with Interactions](pencilkit/customizing-scribble-with-interactions.md)
- [Inspecting, Modifying, and Constructing PencilKit Drawings](pencilkit/inspecting-modifying-and-constructing-pencilkit-drawings.md)
- [Controlling stroke rendering for animation and editing](pencilkit/controlling-stroke-rendering-for-animation-and-editing.md)
- [PKCanvasView](pencilkit/pkcanvasview.md)
- [PKDrawing](pencilkit/pkdrawing-swift.struct.md)
- [PKStrokePath](pencilkit/pkstrokepath-swift.struct.md)
- [PKStrokePoint](pencilkit/pkstrokepoint-swift.struct.md)
- [PKInk](pencilkit/pkink-swift.struct.md)
