Re:NSTouchBar API Reference
by tcper on Thursday October 27, 2016 @09:29PM
(#12812223)
Anyone 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?
[ Parent
| on HN ]
This is a link to the Objective-C API, which is why the "Objective-C" link is disabled (you're already looking at it).
Re:NSTouchBar API Reference
by forgettableuser on Thursday October 27, 2016 @11:14PM
(#12812740)
I 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.
Most 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/
" Swift is intended as a replacement for C-based languages (C, C++, and Objective-C)."
Also on Sierra, launchd and the Dock have been rewritten in Swift.