<!--
{
  "availability" : [
    "watchOS: 3.0.0 - 27.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "ClockKit",
  "identifier" : "/documentation/ClockKit/CLKComplicationDataSource/getLocalizableSampleTemplate(for:withHandler:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "ClockKit"
    ],
    "preciseIdentifier" : "c:objc(pl)CLKComplicationDataSource(im)getLocalizableSampleTemplateForComplication:withHandler:"
  },
  "title" : "getLocalizableSampleTemplate(for:withHandler:)"
}
-->

# getLocalizableSampleTemplate(for:withHandler:)

Gets a localizable template that shows sample data for the specified complication.

```
optional func getLocalizableSampleTemplate(for complication: CLKComplication, withHandler handler: @escaping (CLKComplicationTemplate?) -> Void)
```

## 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 [`CLKComplicationFamily.utilitarianLarge`](/documentation/ClockKit/CLKComplicationFamily/utilitarianLarge), you’d instantiate the [`CLKComplicationTemplateUtilitarianLargeFlat`](/documentation/ClockKit/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

[`localizableTextProvider(withStringsFileTextKey:)`](/documentation/ClockKit/CLKTextProvider/localizableTextProvider(withStringsFileTextKey:))

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

[`localizableTextProvider(withStringsFileFormatKey:textProviders:)`](/documentation/ClockKit/CLKTextProvider/localizableTextProvider(withStringsFileFormatKey:textProviders:))

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

[`localizableTextProvider(withStringsFileTextKey:shortTextKey:)`](/documentation/ClockKit/CLKTextProvider/localizableTextProvider(withStringsFileTextKey:shortTextKey:))

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



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)