7 ms·
Apple introduced Native JavaScript bridge for iOS in iOS 7. you can call objective-c apis in javascript.[1] [1]https://developer.apple.com/library/mac/document
by glasshead969 11y ago
Apple introduced Native JavaScript bridge for iOS in iOS 7. you can call objective-c apis in javascript.[1]
[1]https://developer.apple.com/library/mac/documentation/AppleApplications/Conceptual/SafariJSProgTopics/Tasks/ObjCFromJavaScript.html https://developer.apple.com/library/mac/documentation/AppleA...
- jonknee 11y agoThat's not what this is about though, it's for UI layout (much like with Dashboard). You don't call Objective-C APIs from JS inside a WebKit container, you're actually using JS to layout the app. Update: the docs are up and the JS framework is called TVJS, https://developer.apple.com/library/prerelease/tvos/documentation/TVMLJS/Reference/TVJSFrameworkReference/index.html https://developer.apple.com/library/prerelease/tvos/document...
- glasshead969 11y agoJavaScriptCore framework gives full access to JS runtime.https://www.bignerdranch.com/blog/javascriptcore-and-ios-7/ https://www.bignerdranch.com/blog/javascriptcore-and-ios-7/
- draw_down 11y agoThe docs say you use something called "TVML" to lay out the UI, and inside the TVML you can have JS. I think.
- jonknee 11y agoTVML for layout and TVJS for logic. TVML is just an XML schema for Apple TV UIs and TVJS a Javascript framework to present the XML templates loaded with your data. If you're wanting to stream video you can build a full app with almost no Obj-C/Swift (there's still a small shell, though probably nothing custom needs to be here). The XML templates are a little odd in that they're JS files (e.g. Index.xml.js) and contain the XML as the return value of a global function called Template. It seems really straight forward though.
- deleted 11y ago[deleted]
- jonknee 11y agoIt's a fine use of XML. JSON would be a kludge. The templates look like this: <lockup> <img src="${this.BASEURL}resources/images/music/music_570_e1.lcr" width="450" height="450" /> <title class="showTextOnHighlight">Title 1</title> </lockup>
- thomasfoster96 11y agoI wonder if they're being processed as ES6 Template Strings?