6 ms·
Yes. From the API docs: """There is no need, and no API, for your app to know whether or not there is a Touch Bar available. Whether your app is running on a m
by gcr 10y ago
Yes. From the API docs:
"""There is no need, and no API, for your app to know whether or not there is a Touch Bar available. Whether your app is running on a machine that supports the Touch Bar or not, your app’s onscreen user interface (UI) appears and behaves the same way.
The Touch Bar dims automatically and wakes when the user touches it. Do not show alerts in the Touch Bar, and do not use the Touch Bar for widgets."""
- dahdum 10y agoNothing stopping the developer from showing alerts or ads though right? Your app might not know if it's enabled, but then again can just run 100% of the time in case it is.
- ams6110 10y agoI guess Apple not approving your app for the app store mught be a stopper.
- statictype 10y agoDoes it only work with App Store Apps?
- Gaelan 10y agoDoubt it. Apple demoed it with Photoshop, and I doubt PS is going on the App Store any time soon.
- cyrus_ 10y agoUnless the OS is rendering the bar off-screen even when there isn't a hardware bar, you could trivially determine whether there is a bar by having the code that controls the bar set a flag / send a message.
- colejohnson66 10y agoI sounds to me that it works like an interface. You call function `doFoo()` and if there's a foobar, the OS does foo. If there isn't a foobar, the method does nothing (but both return STATUS_FOO_SUCCESS). For the touch bar, you aren't doing the actual rendering; the OS is. Only the OS knows if there's a touch bar, so without a kext or something, it seems there's no way for you to know if the touch bar exists.
- dom0 10y agoRendering and uploading something (or sending some messages to the touch bar controller; or queuing messages to the touch bar) probably takes a tiny bit longer than if(!touchbar) return MAKE_SUCCESS_GREAT_AGAIN; But then again maybe the user space component just doesn't have that conditional.