Stabilize Curve with CGPath

I am trying to make a drawing app using swift and wanted to add a feature to stabilize the curves that the user draws. Sometimes the curves come out jittery, so I was wondering if there was any kind of algorithm that would look at the point before drawing it to the screen and force it to be closer to the previous point, thereby smoothing it out.
Do you speak of Bezier path ?
How does user perform drawing ?

Could you explain what jitter you observe, in which case ?
Yes I mean Bezier path. Basically when the user drags across the screen (with the apple pencil or other stylus for example) their hand will naturally shake a little bit, so the points being added to the curve are not perfectly straight. I was hoping for a way to move the points closer together regardless of their natural hand jitter. Other drawing apps typically call this a brush stabilizer.
Stabilize Curve with CGPath
 
 
Q