<!--
{
  "availability" : [
    "macOS: 13.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "PencilKit",
  "identifier" : "/documentation/PencilKit/PKStroke-swift.struct/init(ink:path:transform:mask:randomSeed:)-epus",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "PencilKit"
    ],
    "preciseIdentifier" : "s:9PencilKit8PKStrokeV3ink4path9transform4mask10randomSeedAcA5PKInkV_AA0C4PathVSo17CGAffineTransformVSo08NSBezierK0CSgs6UInt32Vtcfc"
  },
  "title" : "init(ink:path:transform:mask:randomSeed:)"
}
-->

# init(ink:path:transform:mask:randomSeed:)

Creates a macOS stroke with the line properties, path, transform, mask, and random seed that you specify.

```
init(ink: PKInk, path: PKStrokePath, transform: CGAffineTransform = .identity, mask: NSBezierPath? = nil, randomSeed: UInt32)
```

## Parameters

`ink`

The [`PKInkReference`](/documentation/PencilKit/PKInkReference) the framework uses to render this stroke.

`path`

The B-spline path that describes this stroke.

`transform`

The <doc://com.apple.documentation/documentation/CoreFoundation/CGAffineTransform> to apply to this stroke. Defaults to <doc://com.apple.documentation/documentation/CoreGraphics/CGAffineTransformIdentity>.

`mask`

The pretransform mask the framework uses to clip the rendering of the stroke.

`randomSeed`

The random seed for the stroke.

---

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)