I am trying to simulate a force touch using Xcode 7 GM on the iPhone 6S or iPhone 6S Plus simulator. In particular, I am trying to simulate the force touch on the icon of the test app which is implementing Application Shortcuts.
Let me know if there is a solution to simulate this, I tried the long press which the Watch simulator uses to simulate force touch, didn't work since the iPhone captures it as a long press gesture.
Update: I downloaded the ViewControllerPreview Sample code from Apple. Running their sample application I see that the simulator, although an iPhone 6s, does not support for 3D / force touch feature. I am still unsure if it would support the feature if I were to be using a macbook with a force touch enabled trackpad.
EDIT: Can someone with a macbook that has a force touch trackpad attempt to use the force touch on the trackpad to simulate 3D touch on the iPhone 6s or 6s Plus simulator? My theory is that you can maybe use the force touch trackpad on the new MacBooks to simulate the 3D touch on new iPhone simulators. Add a comment noting the results if you try it and I can update the post.
EDIT2: It seems that Force Touch trackpads on the newer model macbook pros do not help.
These devices support 3D Touch: iPhone 6s, iPhone 6s Plus, iPhone 7, iPhone 7 Plus, iPhone 8, iPhone 8 Plus, iPhone X, iPhone XS, and iPhone XS Max.
Navigate to System “Settings” > “Peek-a-boo” and set the Sensitivity slider to your desired number. The more the sensitivity, the more the amount of finger touching required to trigger 3D Touch actions.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With