iPhone 3D Touch Demo

iPhone 3D Touch Demo

Finally after more than a year since Apple release a phones with 3D touch, I am writing this blog post. Way to go for my motivation!

If you are willing to do hands on first, please go to my GitHub repository for handling 3D touch and try the demo out

There are 3 types of actions you can do with 3D touch technology.

Tip: Since Apple recently started supporting 3D touches on simulator, I was fortunate enough to use it. The simulator I had to use was iPhone 6s - 9.3. So far touches are kind of subtle and difficult to control in some cases.

  • Home Screen Actions

You can use 3D touch to perform home page actions such as viewing possible options with tasks app can perform. It may included viewing content items, pictures, editing profile or logging out. Remember there are two type of actions developer can add

  • Static Actions

    These are fixed set of actions defined in the application's plist file. These cannot be changed on runtime when app goes one or more state transitions such as like/dislike photo or login/logout actions

  • Dynamic Actions

    As name suggests, these actions can be configured and updated on runtime. This feature allows app to change home page options based on the state app is in. For example, application can show option to show or hide message option based on the login status. If the user is already logged out, it may show only single option to log the user in to use available authenticated features.

home_page_button_actions

  • Peek and Pop actions

Sometimes user wants to perform sub actions before jumping right in main action. Such as while viewing collection of photos, they may want to view its preview first, perform any action before even going into their details.

So with peek action, you can like/unlike or edit/delete photos. With pop action you can actually visit the page to view all the details of an image.

In the Apple's own words,

Peek and Pop let you preview all kinds of content and even act on it — without having to actually open it. For example, with a light press you can Peek at each email in your inbox. Then when you want to open one, press a little deeper to Pop into it

peek_action

pop_action

  • Measuring the force of touch on user interaction

Recently I read an article explaining the use of iPhone to measure weight. I am not sure the feasibility of this feature, but it's really worth taking a look at.

I have added a demo which actually measures the force user put on the screen. Based on my reading on some other blog, the maximum value it displays on screen is lower than actual value device can withstand.I believe Apple has done it on the purpose to deter users from putting unnecessary heavy objects on the screen.

The maximum value of force it can detect is 6.67 units. If you want to use it a weight scale, you can use some formula to map this value into actual weight of an object. Beware though, this force might vary based on whether you are putting a weight on center or on edge

weight_measurement

And finally here is the Gif of full demo:

3D Touch Full Demo

References: