Coding for Apple TV: tvOS Programming Tutorial Overview HD

11.09.2015
Website: https://www.simononstartups.com/developing-for-the-apple-tv-with-tvos-swift-javascript-and-tvml/ References: https://developer.apple.com/library/prerelease/tvos/navigation/ Learn the overall application structure for programming a client server tvOS application for use on the new Apple TV. Apple just announced their new developer platform on September 9, 2015. Learn how to integrate your knowledge of Swift, Javascript, and XML to create Apple TV applications. Excerpt from blog post: Apple introduced the tvOS platform in their September 9th, 2015 event. This developer platform is very interesting, because it incorporates Javascript and TVML, a UI framework that allows developers to easily and quickly design screens to display on the Apple TV. Let’s Get Started To get started, you need to download the latest version of Xcode 7.1 Beta. Previous versions of Xcode don’t have the requisite SDKs, so you’ll need to download this to get started. The file size is about 3-4 GB as usual. One thing to note is that Yosemite is not officially supported. It is recommended that you use OS X 10.11 El Capitan or newer. I’ve, however, successfully used it with Yosemite. Introducing the Apple TV SDK Family Before we get started coding up a simple app, let’s familiarize ourselves with the different components of programming for tvOS. Television Markup Language (TVML) is an XML compatible language to help developers define how pages will look on the Apple TV’s screen. TVJS is a Javascript API Framework to interact with the Apple TV hardware. It includes things like the Device, MenuBarDocument, Playlist, Settings, etc. It also incorporates several Standard Document Object Module Classes from the Web API Javascript Libraries — examples include Document, Element, Event, HTMLCollection, etc. Basic Application Structure It’s important to understand what the overall application structure is so you can wrap your head around the important components of an Apple TV app. First of all, what we’re building here is called a Client-Server App. Here are the steps involved: App Launches on Apple TV Apple TV invokes Javascript file for your application — this controls your application’s logic The Javascript loads a TVML template file which is presented to the Apple TV to display on the television screen — this template file may contain user interface elements like buttons or forms The user interacts with the UI element, such as a button. Your application’s Javascript listens for the events and responds accordingly. Essentially, your app’s logic follows a back and forth structure such as this. The application templates can be “layered” onto each other by pushing them onto the stack. This is essentially the “server” side of the equation. To launch your app, you create a “client” that sits installed on the Apple TV itself. Launching your application Because we’re creating a tvOS app, we still need to launch things with a native application, written in so

Похожие видео

Показать еще