---
title: "getLocalizableSampleTemplate(for:withHandler:)"
framework: clockkit
role: symbol
role_heading: Instance Method
path: "clockkit/clkcomplicationdatasource/getlocalizablesampletemplate(for:withhandler:)"
---

# getLocalizableSampleTemplate(for:withHandler:)

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

## Declaration

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

```swift
optional func localizableSampleTemplate(for complication: CLKComplication) async -> CLKComplicationTemplate?
```

## 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 doc://com.apple.clockkit/documentation/ClockKit/CLKComplicationFamily/utilitarianLarge, you’d instantiate the doc://com.apple.clockkit/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:

## Mentioned in

Adding Placeholders for Your Complication Sharing an Apple Watch face

## Discussion

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

### Related Documentation

- [localizableTextProvider(withStringsFileTextKey:)](clockkit/clktextprovider/localizabletextprovider(withstringsfiletextkey:).md)
- [localizableTextProvider(withStringsFileFormatKey:textProviders:)](clockkit/clktextprovider/localizabletextprovider(withstringsfileformatkey:textproviders:).md)
- [localizableTextProvider(withStringsFileTextKey:shortTextKey:)](clockkit/clktextprovider/localizabletextprovider(withstringsfiletextkey:shorttextkey:).md)

### Deprecated methods

- [CLKLaunchedTimelineEntryDateKey](clockkit/clklaunchedtimelineentrydatekey.md)
- [CLKLaunchedComplicationIdentifierKey](clockkit/clklaunchedcomplicationidentifierkey.md)
- [getComplicationDescriptors(handler:)](clockkit/clkcomplicationdatasource/getcomplicationdescriptors(handler:).md)
- [handleSharedComplicationDescriptors(_:)](clockkit/clkcomplicationdatasource/handlesharedcomplicationdescriptors(_:).md)
- [getPrivacyBehavior(for:withHandler:)](clockkit/clkcomplicationdatasource/getprivacybehavior(for:withhandler:).md)
- [CLKComplicationPrivacyBehavior](clockkit/clkcomplicationprivacybehavior.md)
- [getAlwaysOnTemplate(for:withHandler:)](clockkit/clkcomplicationdatasource/getalwaysontemplate(for:withhandler:).md)
- [getTimelineEndDate(for:withHandler:)](clockkit/clkcomplicationdatasource/gettimelineenddate(for:withhandler:).md)
- [getCurrentTimelineEntry(for:withHandler:)](clockkit/clkcomplicationdatasource/getcurrenttimelineentry(for:withhandler:).md)
- [getTimelineEntries(for:after:limit:withHandler:)](clockkit/clkcomplicationdatasource/gettimelineentries(for:after:limit:withhandler:).md)
- [getTimelineAnimationBehavior(for:withHandler:)](clockkit/clkcomplicationdatasource/gettimelineanimationbehavior(for:withhandler:).md)
- [CLKComplicationTimelineAnimationBehavior](clockkit/clkcomplicationtimelineanimationbehavior.md)
- [getSupportedTimeTravelDirections(for:withHandler:)](clockkit/clkcomplicationdatasource/getsupportedtimetraveldirections(for:withhandler:).md)
- [CLKComplicationTimeTravelDirections](clockkit/clkcomplicationtimetraveldirections.md)
- [getTimelineStartDate(for:withHandler:)](clockkit/clkcomplicationdatasource/gettimelinestartdate(for:withhandler:).md)
