Post

Replies

Boosts

Views

Activity

Reply to PKCanvasView: Apple Pencil interrupts an active finger drawing with .anyInput
Update after further debugging: I instrumented the minimal PKCanvasView test to inspect both PKDrawingGestureRecognizer and the raw UITouch events. This appears to confirm that PencilKit is actively ending the finger input when Apple Pencil begins. With a finger actively drawing, introducing the Pencil causes PKDrawingGestureRecognizer to report: BEGAN | touches: 1 CHANGED | touches: 1 ENDED | touches: 2 I also subclassed PKCanvasView to log the raw touch type and phase. In a test where I started drawing with my finger, kept the finger physically on the screen, and then introduced Apple Pencil, I got: 12256.4750 | FINGER BEGAN | phase: 0 12259.1747 | FINGER ENDED | phase: 3 The FINGER ENDED occurs when the Pencil touches the screen, despite my finger remaining physically down. A fresh PKCanvasView reports isMultipleTouchEnabled == true and drawingGestureRecognizer.cancelsTouchesInView == false, so this does not appear to be normal gesture-recognizer touch cancellation. The behaviour is also asymmetric: if Apple Pencil is drawing first, introducing a finger does not interrupt the Pencil stroke. Is this expected PencilKit behaviour, and is there a supported API or configuration that prevents Apple Pencil input from terminating an already-active finger stroke?
Topic: UI Frameworks SubTopic: UIKit Tags:
15h
Reply to PKCanvasView: Apple Pencil interrupts an active finger drawing with .anyInput
Update after further debugging: I instrumented the minimal PKCanvasView test to inspect both PKDrawingGestureRecognizer and the raw UITouch events. This appears to confirm that PencilKit is actively ending the finger input when Apple Pencil begins. With a finger actively drawing, introducing the Pencil causes PKDrawingGestureRecognizer to report: BEGAN | touches: 1 CHANGED | touches: 1 ENDED | touches: 2 I also subclassed PKCanvasView to log the raw touch type and phase. In a test where I started drawing with my finger, kept the finger physically on the screen, and then introduced Apple Pencil, I got: 12256.4750 | FINGER BEGAN | phase: 0 12259.1747 | FINGER ENDED | phase: 3 The FINGER ENDED occurs when the Pencil touches the screen, despite my finger remaining physically down. A fresh PKCanvasView reports isMultipleTouchEnabled == true and drawingGestureRecognizer.cancelsTouchesInView == false, so this does not appear to be normal gesture-recognizer touch cancellation. The behaviour is also asymmetric: if Apple Pencil is drawing first, introducing a finger does not interrupt the Pencil stroke. Is this expected PencilKit behaviour, and is there a supported API or configuration that prevents Apple Pencil input from terminating an already-active finger stroke?
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
15h