Post

Replies

Boosts

Views

Activity

Reply to PencilKit PKCanvasView flicker
I hit what looks like the same thing in Pen Friend, a handwriting app I'm building on PKCanvasView inside a zooming page, and spent most of a day trying to prove it wasn't my code. I recorded an iPad Air (M4, iPadOS 27.0.1) over USB while writing with the Pencil, and logged every touch, scroll tick, gesture state and app event against a frame counter drawn in the corner of the screen, so each video frame lines up with the log exactly. After writing, when I pan or pinch, strokes coming in at the screen edge are missing for a few frames, then fade in light grey, then go black. In those frames the log has nothing but scroll callbacks, no drawing changes, no layout from my side. It looks like the canvas only has tiles for what was already on screen and renders the new strip late. With synthesized touches I also caught a stroke still being drawn losing part of itself along a tile edge for one frame, again with nothing of mine running. One thing on my side did make it worse, a SwiftUI state change during the pinch was re-running my view update mid gesture, and that frame took about twice as long, right when the edge tiles were coming in. Worth checking if you wrap the canvas in UIViewRepresentable too. I'm filing a Feedback with the recording and the trace and will reference FB25374087 in it.
1d
Reply to PencilKit PKCanvasView flicker
I hit what looks like the same thing in Pen Friend, a handwriting app I'm building on PKCanvasView inside a zooming page, and spent most of a day trying to prove it wasn't my code. I recorded an iPad Air (M4, iPadOS 27.0.1) over USB while writing with the Pencil, and logged every touch, scroll tick, gesture state and app event against a frame counter drawn in the corner of the screen, so each video frame lines up with the log exactly. After writing, when I pan or pinch, strokes coming in at the screen edge are missing for a few frames, then fade in light grey, then go black. In those frames the log has nothing but scroll callbacks, no drawing changes, no layout from my side. It looks like the canvas only has tiles for what was already on screen and renders the new strip late. With synthesized touches I also caught a stroke still being drawn losing part of itself along a tile edge for one frame, again with nothing of mine running. One thing on my side did make it worse, a SwiftUI state change during the pinch was re-running my view update mid gesture, and that frame took about twice as long, right when the edge tiles were coming in. Worth checking if you wrap the canvas in UIViewRepresentable too. I'm filing a Feedback with the recording and the trace and will reference FB25374087 in it.
Replies
Boosts
Views
Activity
1d