Apple Pencil pressure values erratic

I'm trying to use the Apple Pencil pressure values to draw a line of varying thickness. I find that the pressure spikes erratically, often showing full-force at the very end of a stroke, when actually there is no touch. Also the very beginning of a line reports as much higher pressure that quickly drops to something much smaller. And occasionally in the middle of a line when I am drawing lightly, I'll get one or two touches that are spiked really high also.


Is this a common thing? How do you prevent it? I will probably just start filtering the pressures and maybe tossing ones that vary drastically from one point to the next, but it should not be doing this, should it?

Is it in a drawing app or in your own app ?


I assume it's in your own app, otherwise should not be on this forum.


There's an undecidable question here:

- Is it the pressure you put when using the pen ?

- Is it a problem in code or a bug ?


To check the second, would be helpful to see some code.

How do you know the pressure level (may be your code will tell).

Yes my own app, though I see the same thing in other simple drawing apps, like the one from this tutorial:

https://www.raywenderlich.com/121834/apple-pencil-tutorial


When I download and run the starter project from the beginning of that tutorial, I see the same spikes I get in my own app. I don't think the pressure values are supposed to spike like that. Yes, it is the actual touch.forcevalues from touchesMoved that are erratic.


Can we no longer upload images to forum posts? That's lame. I have a screenshot I could upload if it would let me.


I don't really see the same behavior in professional apps like Adobe Sketch, however, so those apps must do some kind of filtering or protection against this type of thing.

I'm still looking for an answer to this, if anyone has worked much with the Pencil...

Apple Pencil pressure values erratic
 
 
Q