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


class CLKTextProvider : NSObject


You don’t create instances of this class yourself. Instead, you create instances of an appropriate subclass, based on the type of text data you’re 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.


Creating a Compound Text Provider

init(format: String, CVarArg...)

Creates and returns a text provider built from the specified format string.

Creating Localized Text Providers

class func localizableTextProvider(withStringsFileTextKey: String) -> Self

Creates a localizable simple text provider using the strings file key for the text.

class func localizableTextProvider(withStringsFileTextKey: String, shortTextKey: String?) -> Self

Creates a localizable simple text provider using strings file keys for both the regular text and the shorter fallback text.

class func localizableTextProvider(withStringsFileFormatKey: String, textProviders: [CLKTextProvider]) -> Self

Creates a localizable text provider with a strings file key that resolves to a format string, and with text providers for the replacement arguments.

Setting the Tint Color

var tintColor: UIColor

The tint color to use for text.

Instance Properties

var accessibilityLabel: String?

A localized string that describes the text.


Inherits From

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 CLKTimeIntervalTextProvider

A formatted time range.

class CLKTimeTextProvider

A formatted time value.

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.