---
title: "init(ink:path:transform:mask:randomSeed:)"
framework: pencilkit
role: symbol
role_heading: Initializer
path: "pencilkit/pkstroke-swift.struct/init(ink:path:transform:mask:randomseed:)-10m5j"
---

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

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

## Declaration

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

## Parameters

- `ink`: The doc://com.apple.pencilkit/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.

## See Also

### 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:)-epus.md)
