Testing 3D touch with iOS Simulator
Asked Answered
B

7

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.

Balch answered 8/10, 2015 at 5:53 Comment(1)
your question is good one'Goidelic
G
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

Goidelic answered 8/10, 2015 at 5:57 Comment(6)
No thats not true. As I mentioned in my post, I see this option enabled on my iPhone 6 S simulator! You want to double check and edit your reply.Balch
Look at @simon answer, Xcode 7.3 simulators support 3D touchCb
@DashAndRest -- the answer is I submitted as couple of month back , now xcode has added this functionGoidelic
Yes, that's great thing Apple, as usual, did!Cb
@DashAndRest -- tanx buddyGoidelic
@DashAndRest -- I am not seen the apple document for this any way I updated the answerGoidelic
E
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.

Elum answered 16/10, 2015 at 3:16 Comment(4)
this is just of the menu !Marcomarconi
Current status: does not work on 9.2 simulator and newer. 9.1 works well.Afroamerican
Can confirm with @OndrejHanak, works fine on 9.1 but not newer simulatorsSwen
It works fine on 9.1, iphone 6s plus simulator. and for other 3d touch capabilities, you need to use Flex on github.Monroy
P
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

Provisory answered 23/2, 2016 at 16:33 Comment(0)
B
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.

Brendonbrenk answered 8/4, 2016 at 2:14 Comment(2)
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?Scary
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.Brendonbrenk
P
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

Pelton answered 25/10, 2015 at 11:36 Comment(0)
D
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

Dwight answered 18/7, 2016 at 12:16 Comment(0)
T
-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

Tushy answered 8/10, 2015 at 5:57 Comment(3)
No that does not work. In fact if you see Anbu answer below, per Apple Documentation : Simulator in Xcode 7.0 does not support 3D Touch.Balch
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 :|Tushy
Those options are just for watch.Backsheesh

© 2022 - 2024 — McMap. All rights reserved.