9 ms·
NSTouchBar API Reference
- tomelders 10y agoIs there any policy to prevent apps displaying ads in the touch bar?
- gcr 10y agoYes. 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.
- ramenmeal 10y agoThis got me thinking, does Apple screen apps as vigorously in the macOS Appstore?
- charlesdm 10y agoSimilar review process
- imron 10y agoBut, you can also release your own apps from your website so unlike iOS it's trivial to release and distribute an app that avoids the app store.
- whywhywhywhy 10y agoJust means they can't use certain OS X tech like iCloud
- mrsteveman1 10y agoIt's a very tiny space but I wouldn't be surprised to see someone try sticking ads there. However, it sounds like in the absence of private framework usage, the only way for your app to show anything in the bar at all is for it to be in the foreground. So it would seem like less of an issue than even showing ads on the main screen, where any app can technically create windows that float over all the others and can't be moved by the user.
- deleted 10y ago[deleted]
- emilong 10y ago> Such an instance is sometimes called, simply, a bar. Kinda funny that a product that was only officially announced today already has a vernacular. :)
- jasonjei 10y agoWhen the OS hasn't initialized Touch Bar, what happens to the Touch Bar? Is there a default Touch Bar loaded in firmware in cases of Linux or Windows in Boot Camp?
- bowmessage 10y agoI hope I can display the world's narrowest game of pong
- mcphage 10y ago> Is there a default Touch Bar loaded in firmware in cases of Linux or Windows in Boot Camp? They'll probably write a driver for it for Windows & Linux that just displays the F-keys.
- developer2 10y agoGood luck with that. The Boot Camp drivers have all but been abandoned. Maybe they'll do a single update soon that will be the only update for the next 5 years. Source: disgruntled Early 2013 MacBook Pro user who can't use the built-in microphone from within Boot Camp.
- stuaxo 10y ago
- orangea 10y agoToo bad there isn't a way to have your app control the touch bar even when it isn't in focus. I would have liked to write a background application that overrides it for personal use. I already have one that does that for the caps lock key.
- nerdponx 10y agoThat's a nice idea, But I could only imagine it would lead to chaos as apps start fighting each other for Touch Bar rights.
- orangea 10y agoIf I were in charge of Apple I'd make the app have to have accessibility rights.
- chrisseaton 10y agoHow come? That seems like a totally unrelated access right to repurpose for this?
- orangea 10y agoI bet there could be some accessibility-related use for the touch bar. Also, accessibility is already tied to completely unrelated things like event taps.
- madeofpalk 10y ago"Accessibility" is kind of the catch all super-permission to give to hooks into greater parts of the operating system. For example, Dropbox requires it for some features, as does an App that hides menubar items.
- prh8 10y agoThat's also how keyboard remapping apps (like Karabiner) work, so it seems plausible here at least.
- 10y ago
- ranman 10y agoSo when will there be a WebKit API for this?
- leesalminen 10y agoThat was my first thought as well. Our product is browser based, and my creative side is already swirling with possibilities.
- lathiat 10y agome too (worth a click, honestly :-): https://twitter.com/rdbaaa/status/791703609008205824 https://twitter.com/rdbaaa/status/791703609008205824
- Tempest1981 10y agoCould you wrap your web app with a thin Mac app, like Kiwi for gmail?
- tarikjn 10y agoI want a device API for third party keyboards, and a split toolbar more for split keyboards. So that third party ergonomic keyboards can be developed building on this.
- leonardoe 10y agoI can't wait to write a nyan cat app for the TouchBar. Hopefully the next XCode build will include a TouchBar simulator so there's no need for me to get a new MBP in order to work on this.
- xenadu02 10y agoIt does, as specified on the linked page :)
- beefsack 10y agoI'm having a little trouble figuring out if this comment was sarcastic or not. Regardless, I think it illustrates pretty clearly why a lot of us are really uninterested in the TouchBar.
- epistasis 10y agoI'm not sure why a particular entertainment application would explain disinterest in the feature. On rough days, I turn on `nyan-mode` [1] in Emacs. I don't think the existence of nyan-mode should turn anybody off from Emacs. [1] https://www.emacswiki.org/emacs/NyanMode https://www.emacswiki.org/emacs/NyanMode
- TeMPOraL 10y agoNyan Mode creator here. If someone borrows me a new Mac for development and testing, I'll happily make it work on the touch bar :).
- imron 10y agoIt also illustrates pretty clearly why the TouchBar is going to take off - all sorts of silly little apps and games that keep people amused for hours.
- a13n 10y agoPacMan!
- JonathonW 10y ago
- ben174 10y agoLooking forward to seeing if a web standard comes of this. Would love to be able to make use of this additional UI in my web apps.
- EpicEng 10y agoPlease don't. I really don't want to be forced to look at my keyboard.
- leesalminen 10y agoThis seems like a developer-centric viewpoint. Users of my app are not tech savvy and this could be a very convenient way of providing shortcuts to things. We already offer customizable keyboard shortcuts but nobody uses them.
- EpicEng 10y agoI think it's a very "I can type without looking at my keyboard" centric view. If your keyboard shortcuts are already going unused it may be a discoverability problem, or it may just be that people who aren't power users will always prefer the mouse/track pad. If that's the case then I'm not sure glitzy icons on the keyboard help them.
- callalex 10y agoEver heard of a UI element called the "toolbar"?
- spiderfarmer 10y agoWhy so condescending? The touchbar's sole reason for existing is for enhancing productivity by making shortcuts discoverable.
- echelon 10y agoThis is also Apple-specific hardware, which kind of flies in the face of becoming a "standard". I hope it doesn't get adopted by other laptop manufacturers. Imagine it does. Then we'll need desktop keyboards to support this standard. I like my wireless keyboard's battery life, and I don't see any benefit in buying a more expensive keyboard with decreased battery life in order to support UI I don't intend to use.
- metaprinter 10y agois the touch bar accessible to folks using screen readers?
- developer2 10y agoI can't see how they would even begin to make that possible. For the next couple of years, the majority of MacBook users will not have a Touch Bar. This means developers will only use it to duplicate functionality that is already accessible in applications. You will not see features that are exclusively found on the Touch Bar. It is encouraging to read this in Apple's documentation[1]: "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." Skip forward 5 years to a time when software developers assume that every Mac user has a Touch Bar. We will get to see just how poorly they make use of the feature. Even as someone without any disabilities, I sincerely hope I am never absolutely required to use the Touch Bar for features that cannot be found elsewhere in an application. [1] https://developer.apple.com/reference/appkit/nstouchbar https://developer.apple.com/reference/appkit/nstouchbar
- madeofpalk 10y agoI would be shocked and surprised that it doesn't have the same VoiceOver APIs available to make it accessible just like iOS.
- callalex 10y agoDidn't you see? Their marketing department made a video with someone in a chair so it's obvious that they super duper care about teh disables
- sctb 10y agoPlease don't comment like this here. https://news.ycombinator.com/newsguidelines.html https://news.ycombinator.com/newsguidelines.html
- 10y ago
- tcper 10y agoAnyone noticed that this NSTouchBar API is not support Objective-C, it is swift-only. Does it mean we would only code Swift for iOS/OS X some day?
- panic 10y agoThis is a link to the Objective-C API, which is why the "Objective-C" link is disabled (you're already looking at it).
- forgettableuser 10y agoI see where the confusion comes from. The example in the middle is in Swift, regardless of which language you've selected. But the API list at the bottom does reflect your current language selection.
- chris_7 10y agoIt subclasses the typical Foundation/AppKit classes, so I don't think that is the case.
- pjmlp 10y agoMost likely Apple is not going to rewrite everything in Swift as that usually leads to more bugs due to missing documentation, but they are pretty clear it is a replacement to C and Objective-C for new code. "Swift is a successor to both the C and Objective-C languages." -- https://developer.apple.com/swift/ https://developer.apple.com/swift/ " Swift is intended as a replacement for C-based languages (C, C++, and Objective-C)." -- https://swift.org/about/ https://swift.org/about/ Also on Sierra, launchd and the Dock have been rewritten in Swift.
- CalChris 10y agoWell, the Slashdot article gets it right: Apple's New MacBook Pro Requires a $25 Dongle To Charge Your iOS Device I like the TouchBar. I really like the Security Enclave. I'm good with losing most of the ports. But they shoulda kept a standard USB port. So this will push my upgrade back not forward. https://hardware.slashdot.org/story/16/10/27/2226215/apples-new-macbook-pro-requires-a-25-dongle-to-charge-your-ios-device https://hardware.slashdot.org/story/16/10/27/2226215/apples-...
- leesalminen 10y agoThis, along with the ditching of MagSafe means I will not be purchasing MBPs anymore. I know that nobody else has magnetic charging now. Hopefully someone does before I have to upgrade.
- eightysixfour 10y agoThe Surface line uses magnetic chargers.
- leesalminen 10y agoI did not know that! I didn't think MS would ever win my business back, but I guess anything is possible.
- cgio 10y agoBut terrible chargers they are. I had to replace mine twice once for my Pro and once for Pro3. The cable bends very unnaturally and is gradually torn from the magnetic connector. Other chargers have a driver piece of plastic where the cable enters the connector that bends nicely to avoid this.
- whywhywhywhy 10y ago> The cable bends very unnaturally and is gradually torn from the magnetic connector Same thing happens with the Magsafe anyway, the eco friendly material they decided to use frays too easily.
- gniquil 10y agoSo who's gonna be working on Sublime/Atom/Vim/Emacs integration on this. Shit, imagine all the things one can do with that bar (multi-touch, slidable, swippable).
- wkirby 10y agoWhat can I do with the bar that I can't do with keyboard commands and my multi-touch touchpad? Vim seems especially rough, with no physical escape key. Guess I'll map that to caps lock?
- gniquil 10y agoIncrease/decrease font size, adjust window height/width. I know you can do it with keyboard, but perhaps touch bar could make it more "natural" and free up key bindings for something else. Escape can be mapped to a double width button on the left.
- wkirby 10y agoHow is this better? I don't have to look at the keyboard to perform chords. With no tactile feedback, I certainly have to look at the touch bar. What's more, common actions usually have high-priority, simple chords (cmd-c/cmd-v, for example) --- whereas complex chords are used for infrequent commands (cmd-alt-shift-c to re-assign the origin in blender, for example). If we're going to surface commands in the touch bar, intuition says to surface the common commands, and leave infrequent ones tucked away, meaning that even with the touch bar you don't have quick or simple access to those commands.
- mthoms 10y agoIf someone can figure out how to trick legacy MacBooks into displaying this bar on the screen of a plugged in iPhone/iPad then you can take my money now. There are so many old iPhone and iPads out there just waiting to be repurposed for something like this. Heck, I'd even be interested in a reasonably priced (< $150) external touch strip as an accessory for my current MBP.
- Gaelan 10y agoXcode can emulate it, so it's probably possible.
- wingerlang 10y agoYou might find this interesting http://quadro.me/ http://quadro.me/
- mthoms 10y agoThis exactly what I need, thank you!
- evanosaurus 10y ago>Do not show alerts in the Touch Bar, and do not use the Touch Bar for widgets. It's interesting, then, that they explicitly showed the Touch Bar being used for alerts in the design video (when the user received a FaceTime call).
- ethbro 10y agoDo as I say, not as I do?
- sjwright 10y agoAn incoming call isn't an alert. It's a highly time sensitive notification. An alert is something that blocks further input until it is dismissed. Something along the lines of "Are you sure you want to disable encryption?" or "This item can not be deleted because it is locked."
- Gaelan 10y agoI think that it was providing shortcuts for interacting with an alert already displayed on the main screen. Apple's worry, I'm assuming, is that alerts will be displayed only on the bar and people without the new Pro will not notice them.
- nicky0 10y agoBut was that an alert, or simply presenting the controls necessary to answer the call?
- increment_i 10y agoInteresting they gave it the legacy 'NextStep' prefix. Although I suppose it makes sense given its a Mac-specific feature.
- DarkByte 10y agoI wonder if the demonstrations had haptic feedback. If not, I wonder if we can use NSHapticFeedbackPerformer to implement it.
- daughart 10y agoThe touch bar doesn't have haptic feedback.
- ideamonk 10y agoTouchBar will play nice with digital audio workstations like Logic Pro / Live, etc. I'll be happy to record pitch/mod/any VST param automations on a touch strip. DJ-ing apps could show up cue points and let you trigger them. While fullscreen mode on macOS advocated distraction-free focus, TouchBar takes a step backwards.
- cobbzilla 10y agoI like the idea of the TouchBar, but I just wish they would have kept a physical escape key. As a heavy emacs user, I'm really going to miss it.
- larme 10y agoA solution is use keychord[1] to map "`1" to ESC [1]: https://www.emacswiki.org/emacs/KeyChord https://www.emacswiki.org/emacs/KeyChord
- adomanico 10y agoActually very pleasantly surprised that this version 1 API has this much publicly customizable features. My guess was that this would be locked down in the first new gen MacBooks
- spiderfarmer 10y agoThey have quite a few launch partners that probably gave them lots of feedback.