问题
I've read a ton of threads debating if 3D touch is available on the latest Xcode 7 versions. The consensus was that it's possible but only with a 3D phone or trackpad. My question is if with the new Xcode and Simulator, has that changed?
I'm on a 2012 MacBook running Sierra:
I can see some force touch options:
But can I somehow enable those options so I can starting testing my 3D Touch code?
回答1:
To test 3D touch in the simulator, you would need a force-touch trackpad (i.e. a MacBook with a force-touch trackpad built in, or a Magic Trackpad 2). If you have one, those menu items come to life. If you don't have one, you can only test on a device!
回答2:
Make sure you also have a device that can support it lol. Had simulator set up to iPhone 5S/SE and didn't realize why it wasn't working (head slap)
回答3:
Only a MacBook Pro or MacBook 12' after 2015 is shipped with a force-touch trackpad which you can use to simulate 3D touch in Xcode's simulator. You can check that with your mac in System Preferences->Trackpad->Point&Click.

来源:https://stackoverflow.com/questions/39670021/3d-touch-on-xcode-8-simulator-10