Returns a new drawing with the specified transform applied.
- parameter transform: The transform to apply to this drawing.
- returns: A new copy of this drawing with `transform` applied.
method · iOS 13.0+
dataRepresentation
TypeScript
dataRepresentation(): ArrayBuffer
Swift declaration
func dataRepresentation() -> Data
get · iOS 17.0+
requiredContentVersion
TypeScript
get requiredContentVersion(): PKContentVersion
Swift declaration
var requiredContentVersion: PKContentVersion { get }
The PencilKit version required to use this drawing.
Draws the drawing in the specified rectangle.
- Parameters:
- context: The graphics context to render into.
- frame: The rectangle (in the coordinate system of the graphics context) in which
to draw the drawing.
- sourceRect: The rectangle (in the drawing coordinate system) from which to draw.
- darkUserInterfaceStyle: Use a dark user interface style for rendering.
init<S>(strokes: S) where S : Sequence, S.Element == PKStroke
Creates a drawing with the specified strokes.
When setting strokes, duplicate IDs are automatically resolved by generating
new UUIDs for conflicting strokes. The first occurrence keeps its original ID.
get · iOS 14.0+
strokes
TypeScript
get strokes(): Array<PKStroke>
Swift declaration
var strokes: [PKStroke] { get set }
The strokes the drawing contains.
When setting strokes, duplicate IDs are automatically resolved by generating
new UUIDs for conflicting strokes. The first occurrence keeps its original ID.
set · iOS 14.0+
strokes
TypeScript
set strokes(value: Array<PKStroke>)
Swift declaration
var strokes: [PKStroke] { get set }
The strokes the drawing contains.
When setting strokes, duplicate IDs are automatically resolved by generating
new UUIDs for conflicting strokes. The first occurrence keeps its original ID.
Returns a new drawing with the contents of the specified drawing appended.
- parameter drawing: The drawing to append.
- returns: A new copy of this drawing with `drawing` appended.