How to enable Force Touch Pressure on iOS Simulato

2019-06-20 08:56发布

The new 9.1 simulator with Xcode 7.1 has the feature to simulate a force touch like the iPhone 6s / 6s+ but the option is greyed / disabled.

iOS Simulator > Hardware > Force Touch Pressure [disabled] Screenshot for reference

Force Touch Pressure Disabled Screenshot

Anybody know how to enable this option?.

Note: Im testing this on a iPhone 6s simulator

4条回答
Emotional °昔
2楼-- · 2019-06-20 09:11

On the Apple Developer website, it says:

NOTE

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

Apparently, the new Simulator 9.1 does not support 3D Touch. You can actually implement such a behavior but (unfortunately) you have to test it on real a device that supports 3D Touch.

I guess we all have to wait for the next issue of Xcode.

See here for similar discussion and way to test force touch only for quick actions (on the app icon).

查看更多
男人必须洒脱
3楼-- · 2019-06-20 09:13

Simulator does not support interaction with iOS Devices using 3D Touch prior to Xcode 7.3. The menu item that you are referencing relates only to Apple Watch devices.

查看更多
对你真心纯属浪费
4楼-- · 2019-06-20 09:22

select simulator(watch) --> Hardware --> Force Touch Pressure --> Deep Press, and then click and hold on simulator, menu will be popup. you don't need to real device to test context menu.

enter image description here

查看更多
Summer. ? 凉城
5楼-- · 2019-06-20 09:32

It is true that by far (Xcode 10.1) iOS simulator still does not support 3D touch if your Mac doesn't have touchpad with this capability.

However, there are a few libraries like this that swizzle system's touch event handling and inject 3D touch feature. Of course, you don't want this code to be included in your production code to avoid being rejected on app's review, but you can certainly use this for development!

The library I mentioned works great for my Swift 4.1 project.

查看更多
登录 后发表回答