How to work with 3D Touch in iOS 9? Does this event mean when pressure changes?

I wonder if I can constantly detect user input pressure on the iPhone 6s.

With a simple touch you can see that from UIResponder you can connect to Began and TouchesMoved contacts, and you will have coordinates every time the user touches the screen and when he moves his finger, you can have the current position on each update.

However, I'm not sure how the new: force property works. If you read the β€œforce” in touchsBegan, will you not get the minimum pressure value that was detected when you started touching?

Is there a way to get an update of a force value as it changes, just like touching a Loved? Maybe there is a method like forceChanged?

+7
ios uikit uitouch
source share
1 answer

From iOS 9.1 Release Notes

In devices that support 3D Touch, sensory pressure changes cause Touch: Moved: to call.

Applications should be prepared to receive touch move events without changing x / y coordinates.

This means that the touchesMoved: callback indicates a continuous change in force or place, or both!

Hopefully this information will one day appear in the UITouch documentation .

+11
source share

All Articles