Instance Method

getLocalizableSampleTemplateForComplication:withHandler:

Called to get a localizable template that shows sample data for the specified complication.

Declaration

- (void)getLocalizableSampleTemplateForComplication:(CLKComplication *)complication withHandler:(void (^)(CLKComplicationTemplate *complicationTemplate))handler;

Parameters

complication

The complication tied to the request. Use the complication family information in this object to determine which set of templates are valid. For example, if the complication family is CLKComplicationFamilyUtilitarianLarge, you would instantiate the CLKComplicationTemplateUtilitarianLargeFlat class for your template.

handler

The handler to execute with the template. This block has no return value and takes the following parameter:

template

The template object containing your placeholder data. The data in this template is cached and displayed for your complication.

Discussion

The system calls this method once per supported complication when your extension is installed, and the results are cached. In your implementation, instantiate the appropriate template class and populate the resulting object with localized data. The data you supply should be fake, but it should reflect what your complication would normally look like.

If you pass nil to the handler, the system generates a default placeholder template from your app’s icon and name.

See Also

Providing Templates

getPlaceholderTemplateForComplication:withHandler:

Called to get a static template to display in the selection screen for your complication.

Deprecated