Framework

TVMLKit

Evaluate TVMLKit JS and TVML files from within your tvOS app. Customize and create TVML elements, styles, views, and view controllers through the JavaScript environment.

Overview

The TVMLKit framework enables you to incorporate JavaScript and TVML files in your binary apps to create client-server apps.

Topics

Interacting with the JavaScript Environment

class TVApplicationController

The TVApplicationController class establishes the JavaScript environment and provides a centralized point of control and coordination between the JavaScript environment and tvOS. The class bridges the UI, navigation stack, storage, and event handling from JavaScript.

class TVApplicationControllerContext

The TVApplicationControllerContext class provides launch information to the TV application controller.

protocol TVApplicationControllerDelegate

The TVApplicationControllerDelegate protocol defines methods that allow you to observe and manage different states of a TVApplicationController object.

Creating Views and View Controllers

protocol TVInterfaceCreating

The TVInterfaceCreating factory protocol declares methods that are used to create views and view controllers from a TVViewElement.

class TVInterfaceFactory

The TVInterfaceFactory class provides a factory for the creation of views and view controllers. The app can extend or override the framework implementation by setting extendedInterfaceCreator.

class TVViewElement

A TVViewElement object represents a read-only DOM node along with it's attributes and aggregated styles. The TVViewElement model object is traversed by the TVInterfaceFactory factory to construct views and view controllers, and to render templates. Views and view controllers should use the available dispatch APIs to send user events to JavaScript.

Working with Custom Styles

class TVColor

The TVColor class describes the color data used by color styles.

class TVViewElementStyle

A TVViewElementStyle object represents a style applied to a view element.

class TVStyleFactory

The TVStyleFactory class is used to register custom style properties.

Working with Custom Elements

class TVElementFactory

The TVElementFactory class lets you register new elements to extend the Apple TV Markup Language (TVML). You must register new elements before initializing a TVApplicationController object.

class TVImageElement

A TVImageElement object represents a read-only DOM node containing the attributes that describe an image element.

class TVTextElement

A TVTextElement object that represents the textual content for the DOM element.