Framework

ClockKit

Implement complications for the clock face.

Overview

The ClockKit framework (ClockKit.framework) supports the management of complications associated with a Watch app. Use the classes of this framework to specify the complication styles your app supports and to provide the data associated with those complications. Your complication data source manages the creation of your complications when prompted by the system.

Symbols

Classes

CLKComplication

A CLKComplication object contains metadata about one of your custom complications. You do not create instances of this class directly. Instead, you retrieve them from the CLKComplicationServer object. Complication objects are only available when your complication is in use on the clock face.

CLKComplicationServer

The shared CLKComplicationServer object manages the active complications for a given app. Do not create instances of this class directly. Instead, use the shared object to fetch information about your active complications and to invalidate or extend the data for a specific complication. You can also use it to get information about the minimum and maximum dates for which you need to provide data to support Time Travel.

CLKComplicationTemplate

The CLKComplicationTemplate class is a base class for specifying the arrangement of data in your custom watch complication. You do not create instances of this class directly. Instead, you create instances of one of the concrete subclasses and use the resulting object to specify the data for your complication.

CLKComplicationTemplateCircularSmallRingImage

A CLKComplicationTemplateCircularSmallRingImage object is a template for displaying complication data on the clock face. Use this template when you want to display a single image surrounded by a configurable progress ring for a complication in the circularSmall family.

CLKComplicationTemplateCircularSmallRingText

A CLKComplicationTemplateCircularSmallRingText object is a template for displaying complication data on the clock face. Use this template when you want to display a short text string encircled by a configurable progress ring for a complication in the circularSmall family.

CLKComplicationTemplateCircularSmallSimpleImage

A CLKComplicationTemplateCircularSmallSimpleImage object is a template for displaying complication data on the clock face. Use this template when you want to display a single image for a complication in the circularSmall family.

CLKComplicationTemplateCircularSmallSimpleText

A CLKComplicationTemplateCircularSmallSimpleText object is a template for displaying complication data on the clock face. Use this template when you want to display a short text string for a complication in the circularSmall family.

CLKComplicationTemplateCircularSmallStackImage

A CLKComplicationTemplateCircularSmallStackImage object is a template for displaying complication data on the clock face. Use this template when you want to display an image with a line of text below it for a complication in the circularSmall family.

CLKComplicationTemplateCircularSmallStackText

A CLKComplicationTemplateCircularSmallStackText object is a template for displaying complication data on the clock face. Use this template when you want to display two text strings stacked on top of each other for a complication in the circularSmall family.

CLKComplicationTemplateExtraLargeColumnsText

A CLKComplicationTemplateExtraLargeColumnsText object is a template for displaying complication data on the clock face. Use this template when you want to display two rows and two columns of text for a complication in the extraLarge family.

CLKComplicationTemplateExtraLargeRingImage

An extra large template that displays an image encircled by a configurable progress ring.

CLKComplicationTemplateExtraLargeRingText

An extra large template that displays text encircled by a configurable progress ring.

CLKComplicationTemplateExtraLargeSimpleImage

An extra large template that displays an image.

CLKComplicationTemplateExtraLargeSimpleText

An extra large template that displays a small amount of text.

CLKComplicationTemplateExtraLargeStackImage

An extra large template that displays a single image with a short line of text below it.

CLKComplicationTemplateExtraLargeStackText

An extra large template that displays two strings stacked one on top of the other.

CLKComplicationTemplateModularLargeColumns

A CLKComplicationTemplateModularLargeColumns object is a template for displaying complication data on the clock face. Use this template when you want to display multiple columns of data for a complication in the modularLarge family.

CLKComplicationTemplateModularLargeStandardBody

A CLKComplicationTemplateModularLargeStandardBody object is a template for displaying complication data on the clock face. Use this template when you want to display a header row and two lines of text for a complication in the modularLarge family.

CLKComplicationTemplateModularLargeTable

A CLKComplicationTemplateModularLargeTable object is a template for displaying complication data on the clock face. Use this template when you want to display a header row and columns for a complication in the modularLarge family.

CLKComplicationTemplateModularLargeTallBody

A CLKComplicationTemplateModularLargeTallBody object is a template for displaying complication data on the clock face. Use this template when you want to display a header row and a tall row of body text for a complication in the modularLarge family.

CLKComplicationTemplateModularSmallColumnsText

A CLKComplicationTemplateModularSmallColumnsText object is a template for displaying complication data on the clock face. Use this template when you want to display two rows and two columns of text for a complication in the modularSmall family.

CLKComplicationTemplateModularSmallRingImage

A CLKComplicationTemplateModularSmallRingImage object is a template for displaying complication data on the clock face. Use this template when you want to display an image encircled by a configurable progress ring for a complication in the modularSmall family.

CLKComplicationTemplateModularSmallRingText

A CLKComplicationTemplateModularSmallSimpleText object is a template for displaying complication data on the clock face. Use this template when you want to display text encircled by a configurable progress ring for a complication in the modularSmall family.

CLKComplicationTemplateModularSmallSimpleImage

A CLKComplicationTemplateModularSmallSimpleImage object is a template for displaying complication data on the clock face. Use this template when you want to display an image for a complication in the modularSmall family.

CLKComplicationTemplateModularSmallSimpleText

A CLKComplicationTemplateModularSmallSimpleText object is a template for displaying complication data on the clock face. Use this template when you want to display a small amount of text for a complication in the modularSmall family.

CLKComplicationTemplateModularSmallStackImage

A CLKComplicationTemplateModularSmallStackImage object is a template for displaying complication data on the clock face. Use this template for complications in the modularSmall family that contain a single image with a short line of text below it.

CLKComplicationTemplateModularSmallStackText

A CLKComplicationTemplateModularSmallStackText object is a template for displaying complication data on the clock face. Use this template when you want to display two strings stacked one on top of the other for a complication in the modularSmall family.

CLKComplicationTemplateUtilitarianLargeFlat

A CLKComplicationTemplateUtilitarianLargeFlat object is a template for displaying complication data on the clock face. Use this template when you want to display an image and string in a single long line for a complication in the utilitarianLarge family.

CLKComplicationTemplateUtilitarianSmallFlat

A small flat template that displays an image and text in a single.

CLKComplicationTemplateUtilitarianSmallRingImage

A CLKComplicationTemplateUtilitarianSmallRingImage object is a template for displaying complication data on the clock face. Use this template when you want to display an image encircled by a configurable progress ring for a complication in the utilitarianSmall family.

CLKComplicationTemplateUtilitarianSmallRingText

A CLKComplicationTemplateUtilitarianSmallRingText object is a template for displaying complication data on the clock face. Use this template when you want to display text encircled by a configurable progress ring for a complication in the utilitarianSmall family.

CLKComplicationTemplateUtilitarianSmallSquare

A CLKComplicationTemplateUtilitarianSmallSquare object is a template for displaying complication data on the clock face. Use this template when you want to display a single square image for a complication in the utilitarianSmall family.

CLKComplicationTimelineEntry

A CLKComplicationTimelineEntry object contains a complication template object and the time at which to display it. Each entry object represents a single data point along your complication’s timeline. You create and return timeline entries when asked to do so by ClockKit. When the date associated with a particular timeline entry occurs, ClockKit updates your complication’s interface with the data in the accompanying template object.

CLKDateTextProvider

A CLKDateTextProvider object creates a formatted string that conveys a date without any time information. Use a date provider for strings that contain day, month, and year information. The text provider formats the date information consistently and in a way that makes the best use of the available space. It also takes into account the user’s region and locale settings.

CLKImageProvider

A CLKImageProvider object manages an image displayed by a complication. You create an image provider with at least one image and may specify two additional images to use under certain conditions. The images you specify are template images that have a color applied to them prior to display. The clock face displaying the complication determines how the images are composited together and which tint color is applied.

CLKRelativeDateTextProvider

A CLKRelativeDateTextProvider object creates a formatted string that conveys the difference in time between the current date and a date that you specify. You use a relative date text provider to implement timers or other relative time values in an efficient way. Instead of using multiple timeline entries to replicate a countdown timer, create a single timeline entry with a relative date text provider. When the user views the clock face, ClockKit automatically updates the relative time value in your complication, providing up-to-date time information.

CLKSimpleTextProvider

A CLKSimpleTextProvider object contains a single line of text to display in your complication interface. Use these objects to specify strings that you provide. The simple text object handles the formatting of that string in your complication, which may include tinting it to match the color of the clock face.

CLKTextProvider

The CLKTextProvider class is the base class for specifying text-based data in a complication. You do not create instances of this class yourself. Instead, you create instances of an appropriate subclass, based on the type of text data you are trying to create. You can also use the textProviderWithFormat: class method to create a generic text provider constructed from a format string and the data from other text provider

CLKTimeIntervalTextProvider

A CLKTimeIntervalTextProvider object formats a time range so that it can be displayed by your complication. This provider creates strings like “10:15–11:15AM” where the time range may span hours, days, or some larger time interval. The text provider takes into account the user’s region and locale settings.

CLKTimeTextProvider

A CLKTimeTextProvider object formats a time value so that it can be displayed in your complication. This provider supports time values in either the 24-hour or 12-hour format and takes into account the user’s region and locale settings. As needed, the provider automatically shortens the string to fit the available space.

Protocols

CLKComplicationDataSource

The CLKComplicationDataSource protocol defines the methods that you use to communicate with the ClockKit framework. Apps that support a complication must define a class that supports this protocol and register it with the system. Your data source object provides the timeline entries displayed by your complication and provides information about the features that your complication supports.

Structures

CLKComplicationTimeTravelDirections

Constants indicating the supported time travel directions, if any.

Extended Types

NSNotification.Name

The type used for the name of a notification.