Testing 3D touch with iOS Simulator

15,164

Solution 1

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

Solution 2

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.

Solution 3

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

Solution 4

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.

Solution 5

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

Share:
15,164
Abhinav
Author by

Abhinav

Updated on June 04, 2022

Comments

  • Abhinav
    Abhinav about 2 years

    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.