---
title: "init(ink:strokePath:transform:mask:)"
framework: pencilkit
role: symbol
role_heading: Initializer
path: "pencilkit/pkstrokereference/init(ink:strokepath:transform:mask:)"
---

# init(ink:strokePath:transform:mask:)

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

## Declaration

```swift
init(ink: PKInk, strokePath: PKStrokePath, transform: CGAffineTransform, mask: UIBezierPath?)
```

```swift
init(ink: PKInk, strokePath: PKStrokePath, transform: CGAffineTransform, mask: NSBezierPath?)
```

## Parameters

- `ink`: The doc://com.apple.pencilkit/documentation/PencilKit/PKInkReference the class uses to render this stroke.
- `strokePath`: 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 class uses to clip the rendering of the stroke.

## See Also

### Creating a stroke object

- [init(ink:strokePath:transform:mask:randomSeed:)](pencilkit/pkstrokereference/init(ink:strokepath:transform:mask:randomseed:).md)
