A formatted time value.


class CLKTimeTextProvider : CLKTextProvider


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.

When formatting the time, the time text provider drops the morning/evening indicator if it can’t fit the entire time value. For example, a provider configured to display the time 10:09AM in the English-US locale would remove elements as follows until it encountered a string that fit the available space:

  • 10:09AM

  • 10:09


Creating a Text Provider

init(date: Date)

Creates and returns a text provider for displaying the specified time.

init(date: Date, timeZone: TimeZone?)

Creates and returns a text provider for displaying the specified time.

Getting the Time Information

var date: Date

The date object containing the time value.

var timeZone: TimeZone?

The time zone used to format time values.


Inherits From

Conforms To

See Also

Data Providers

class CLKDateTextProvider

A formatted string that conveys a date without any time information.

class CLKImageProvider

An image displayed by a complication.

class CLKFullColorImageProvider

A full-color image displayed by a complication.

class CLKRelativeDateTextProvider

A formatted string that conveys the difference in time between the current date and a date that you specify.

class CLKSimpleTextProvider

A single line of text to display in your complication interface.

class CLKTextProvider

The common behavior for displaying text-based data in a complication.

class CLKTimeIntervalTextProvider

A formatted time range.

class CLKSimpleGaugeProvider

A gauge that shows a fractional value.

class CLKTimeIntervalGaugeProvider

A gauge that tracks time intervals.

class CLKGaugeProvider

An abstract superclass that provides all the common behaviors for the gauge providers.

let CLKSimpleGaugeProviderFillFractionEmpty: Float

A fill value indicating an empty gauge.

enum CLKGaugeProviderStyle

Visual styles available for gauges.