I wonder if I can detect continuously changing pressure of user input on iPhone 6s.
With simple touch it's obvious, from the UIResponder you can hook into touchesBegan and TouchesMoved and you'll have the coordinates every time when the user touches the screen and when moves his/her finger, you can have the current position on every update.
However, I'm not sure how the new :force property works. If you read the "force" in touchesBegan, wouldn't you get some minimal pressure value that was detected at the initiation of the touch?
Is there a way to get update on the force value as it changes, just like the touchesMoved? Maybe there is a method like "forceChanged"?
3D Touch makes your iPhone pressure-sensitive, so it knows how hard you are pressing on the screen. In fact, 3D Touch has three distinct levels of sensitivity, and can perform three different actions depending upon how hard you press. A normal, light press has the same effect it always has.
Apple's Haptic Touch technology is similar to 3D Touch but it doesn't rely on pressure. Instead, Haptic Touch kicks in when a user long-presses the screen, offering a small vibration as acknowledgement following the press; haptic feedback, hence the Haptic Touch name.
On iPhones with 3D Touch, the capacitive sensors are directly integrated into the display. When a press is detected, these capacitive sensors measure microscopic changes in the distance between the back light and the cover glass. On the Apple Watch, a series of electrodes line the curvature of the screen.
From the iOS 9.1 Release Notes
On 3D Touch capable devices, touch pressure changes cause touchesMoved: to be called.
Apps should be prepared to receive touch move events with no change in the x/y coordinates.
This means that a touchesMoved:
callback either indicates a continuous change in force
or location or both!
Hopefully this information will one day make it into the UITouch documentation
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With