Simulate force touch / 3D touch on iPhone 6S or iPhone 6S Plus simulators Simulate force touch / 3D touch on iPhone 6S or iPhone 6S Plus simulators ios ios

Simulate force touch / 3D touch on iPhone 6S or iPhone 6S Plus simulators


It says here! at the bottom of the page....

Development Environment

Xcode 7 supports 3D Touch development. All the debugging features of Xcode are available for implementing the new features.

Keep the following in mind:

With Xcode 7.0 you must develop on a device that supports 3D Touch. Simulator in Xcode 7.0 does not support 3D Touch.

With Xcode 7.0 you must implement your peek and pop view controllers in code. Interface Builder in Xcode 7.0 does not provide graphical support for configuring view controllers or transitions for 3D Touch.

Be sure to test your app with 3D Touch both enabled and disabled, ensuring that all features are available to all users. On a 3D Touch device, you can disable 3D Touch in Settings > General > Accessibility > 3D Touch

So unfortunately it looks like we need to get our hands on the actual devices to do it. :-(

EDIT.....

As of Xcode 7.3 there is a way to do this if your MacBook's trackpad supports force touch. See answer by @iPrabu.


For those that are developing Quick Actions (App Shortcuts) you can use this script that enables you to simulate a deep press on an app on the simulator.

https://github.com/DeskConnect/SBShortcutMenuSimulator

Here's a screenshot:enter image description here

For those that are looking at how to add the actions on the first place, there are two options, Static and Dynamic. You can set only 4 options, it will first show all Static ones, and if there's space, show Dynamic ones.

Here's how to add Static shortcuts. It's pretty easy, just add some keys on the main Info.plist

In this example i will be adding two static options one with Default Search icon, and the other with custom icon from asset catalog.

<key>UIApplicationShortcutItems</key><array>    <dict>        <key>UIApplicationShortcutItemTitle</key>        <string>Add Event (with custom icon)</string>        <key>UIApplicationShortcutItemType</key>        <string>com.reverse.appname.addevent</string>        <key>UIApplicationShortcutItemIconFile</key>        <string>custom-icon-from-asset-catalog</string>        <key>UIApplicationShortcutItemSubtitle</key>        <string>Here you can add some text below the option</string>    </dict>    <dict>        <key>UIApplicationShortcutItemTitle</key>        <string>Search Event (with default icon)</string>        <key>UIApplicationShortcutItemType</key>        <string>com.reverse.appname.searchevents</string>        <key>UIApplicationShortcutItemIconType</key>        <string>UIApplicationShortcutIconTypeSearch</string>        <key>UIApplicationShortcutItemSubtitle</key>        <string>Here you can add some text below the option</string>    </dict></array>


With Xcode 7.3 you can test the 3D touch feature in simulator but with only one constraint. (Xcode7.3 release notes reference)

The machine(macbook/mac with trackpad) your are developing should have 3D touch capability.

You can find it under iOS simulator Hardware menu.

Comments from Pavel Alexeev: Be sure to enable “Force Click and haptic feedback” in System Preferences → Trackpad

enter image description here