10

Questions:

I was wondering if anyone has tried 3D touch feature on a simulator or rather anyone know whether it actually works there or not.

I know it's a hardware based feature and support is there only for latest iPhone 6S & iPhone 6S Plus models.

On an iPhone 6S simulator, I have tried with Hardware --> Force Touch Pressure --> Deep Press but no gain.

Anbu.Karthik
  • 82,064
  • 23
  • 174
  • 143
Abhinav
  • 37,684
  • 43
  • 191
  • 309

7 Answers7

8

you must develop on a device that supports 3D Touch. Simulator does not support 3D Touch,the documentation from apple, if you need the more information related to this topic, visit this link.

Update

The iOS simulator with Xcode 7.3 beta has an option to Use Trackpad Force for 3D Touch

Community
  • 1
  • 1
Anbu.Karthik
  • 82,064
  • 23
  • 174
  • 143
7

Yes, we can not on Xcode 7.0

BUt there is a way to simulate this by using https://github.com/DeskConnect/SBShortcutMenuSimulator

This saved me once. Hope could save you. Notice that this is using for Quick Actions of 3D force touch features.

Nghia Luong
  • 790
  • 1
  • 6
  • 11
6

With Xcode 7.3 beta you can now use 3D touch using a Magic Trackpad 2 or the built-in in newer MacBooks.
enter image description here

Simon
  • 1,076
  • 7
  • 13
5

If you do not have Force Touch trackpad AND iOS device with 3D Touch. By using only the simulator, you can use FLEX.

It works on my Xcode 7.2.1 and iPhone 6S simulator. But the tutorial to use in documentation is not quite right.

For peeking, You need to move a bit of your mouse cursor to let it work while holding Shift + Command.

For Popping, While holding Shift + Command during peeking, press Control 3 times to pop out. I think 3 times means the hardest force applied, as the document stated, each key contributes 1/3 of maximum possible force.

felixwcf
  • 2,078
  • 1
  • 28
  • 45
  • Hello there, I am trying without force touch trackpad. Cant simulate the 3D touch in 6S simulator from the github example of FLEX. Can you help me with that? – Ashik Feb 06 '17 at 18:48
  • It works for me in my project with 3D touch feature implemented by myself. Perhaps you should try on the project your own instead of the github example. – felixwcf Feb 07 '17 at 04:02
2

There's a bit of code here that allows you to test 3D Touch peek & pop in the simulator. Bear in mind this is code for iOS 9.0, and some of the internal/private methods have changed in 9.1 (Hint: the word 'Position' changed to 'Location' in one of the method names).

https://gist.github.com/nickfrey/07e2c6d8d2e5444fb91d

Jordan Smith
  • 10,310
  • 7
  • 68
  • 114
1

From Xcode 7.3 we can use Macbook's force touch trackpad to deliver touch pressure events to iOS simulator.

Ensure iPhone 6s/ iPhone 6s plus simulator is selected or else "Use trackpad ..." option will appear disabled

prashanth
  • 9
  • 2
-7

You can do with shortkeys present on the simulator, under Hardware > Force Touch Pressure

command + shift + 1 for shallow touch

command + shift + 2 for deep touch

Raheel Sadiq
  • 9,847
  • 6
  • 42
  • 54
  • 2
    No that does not work. In fact if you see Anbu answer below, per [Apple Documentation](https://developer.apple.com/library/prerelease/ios/documentation/UserExperience/Conceptual/Adopting3DTouchOniPhone/) : **Simulator in Xcode 7.0 does not support 3D Touch.** – Abhinav Oct 08 '15 at 06:06
  • yes right couldn't get it working, I hoped that the options are there, may be there is some ways, I tried with the forcetouch trackpad didn't work either :| – Raheel Sadiq Oct 08 '15 at 06:13
  • Those options are just for watch. – Jeremy Huddleston Sequoia Oct 08 '15 at 19:20