Handwriting App for automaticity

Does PaperKit expose the underlying PKDrawing / PKStroke / PKStrokePath data in a way that preserves stroke order, point sequence, and per-point properties, or is it primarily intended for markup persistence and rendering?

Answered by in 891185022

PaperKit PaperMarkup exposes var subelements: MarkupOrderedSet. This contains all the PKStrokes with all the same PencilKit data. This gives you all the stroke order, point sequence, and per-point properties.

If you want a PKDrawing you can do PKDrawing(strokes: markup.subelements.strokes)

Accepted Answer

PaperKit PaperMarkup exposes var subelements: MarkupOrderedSet. This contains all the PKStrokes with all the same PencilKit data. This gives you all the stroke order, point sequence, and per-point properties.

If you want a PKDrawing you can do PKDrawing(strokes: markup.subelements.strokes)

Thank you — these answers are very helpful.

One follow-up regarding the automaticity/fluency side of the app:

When analyzing handwriting with PencilKit or PaperKit, is there any reliable timestamp or timing information available at the stroke or point level? For example, can an app determine stroke duration, pauses between strokes, or elapsed time across points in a PKStrokePath?

Or is the recommended approach to use PencilKit/PaperKit primarily for the final stroke geometry, while separately capturing timing data in the app, such as latency before first stroke, total trial time, and pauses between completed strokes?

I’m trying to determine whether handwriting fluency/automaticity measures should be derived from the PencilKit/PaperKit data model itself, or from a separate timing model maintained by the app.

PKStrokePath has a creationDate: Date property and the individual PKStrokePoints in the path have a timeOffset from that initial creation date.

I would use these first, they are probably enough for your needs. Trying to matchup your timing data to PKStroke would be a little tricky, but you can add a concurrent gesture recognizer to the canvas if you want to capture your own data.

Handwriting App for automaticity
 
 
Q