Generic Structure

WKInterfaceObjectRepresentableContext

Contextual information about the state of the system that you use to create and update your WatchKit interface object.

Declaration

struct WKInterfaceObjectRepresentableContext<Representable> where Representable : WKInterfaceObjectRepresentable

Overview

A WKInterfaceObjectRepresentableContext structure contains details about the current state of the system. When creating and updating your interface objects, the system creates one of these structures and passes it to the appropriate method of your custom WKInterfaceObjectRepresentable instance. Use the information in this structure to configure your object. Don't create this structure yourself.

Topics

Coordinating Interactions

let coordinator: Representable.Coordinator

The view’s associated coordinator.

var transaction: Transaction

The current transaction.

Getting the Current Environment Data

var environment: EnvironmentValues

The current environment.

See Also

Creating and Updating the Interface Object

func makeWKInterfaceObject(context: Self.Context) -> Self.WKInterfaceObjectType

Creates a WatchKit interface object and configures its initial state.

Required.

func updateWKInterfaceObject(Self.WKInterfaceObjectType, context: Self.Context)

Updates the presented WatchKit interface object (and its coordinator) to the latest configuration.

Required.