-1

How can I simulate 3D Touch in my app, like in the Instagram app?

Instagram simulates 3D Touch in all devices.

Now that Telegram allows this feature, it is possible to see the coversation without entering in the chat.

This is an example:

enter image description here

If I press a photo for a few seconds, I obtain a preview of the photo.

Dalton
  • 25
  • 6
ivan180593
  • 54
  • 1
  • 10

1 Answers1

2

3D touch is based on the sensors built into the latest version of iPhone. A "3D" touch is not recognized by length of touch but rather by pressure exerted on the display. A simple way that one could allow user access to the benefits of 3D touch without the user having the device with such capabilities would be to implement a touch-timer in which a long touch(2-3 seconds?) would be recognized as a long touch and allow access to extended features.

Dalton
  • 25
  • 6
  • 1
    There is a built-in gesture recognizer for this: `UILongPressGestureRecognizer` – Avi Jun 28 '16 at 03:56