How to get Apple Pencil Tilt

38 Views Asked by At

I have an app that I want to use the apple pencil tilt functionality.

Right now this is what i am doing:

let tilt = UITouch().altitudeAngle
                    
                    print(tilt)
                    
                    
                    lines.append(Line(points: [newPoint], color: selectedColor, lineWidth: tilt))

But when I print tilt, I am always getting 0.0

Am I doing something wrong?

0

There are 0 best solutions below