简体   繁体   中英

Is there a way to simulate the 2016 MacBook Pro's TouchBar in Xcode 8.1?

I'm looking to write a program tailored to the announced, but not-yet-released MacBook Pro with Touch Bar. Is there a way to simulate the Touch Bar similar to the way iPhone/Apple Watch apps can be simulated from Xcode?

Yes, there are references and sample code here (and it works with Xcode 8.1).

Download and install the latest versions of Xcode 8 and macOS Sierra, and use the development resources to learn about creating apps that use the Touch Bar.

Most notably, Showing the Touch Bar simulator in Xcode :

Show the Touch Bar simulator by choosing Window > Show Touch Bar .

The simulator represents the Touch Bar in a floating window regardless of whether your Mac is equipped with a Touch Bar. Use the simulator to preview, test, and debug the NSTouchBar objects you define in your app.


Edit: Touch Bar simulation isn't available on macOS 10.12.1 build 16B2555. If you're running this build you'll need to manually download and install 10.12 build 12B2657 (or later) via https://support.apple.com/kb/dl1897

Command + Shift + 8是相同的快捷方式

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM