Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
getLocalizableSampleTemplateForComplication
#pragma mark - Placeholder Templates
- (void)getLocalizableSampleTemplateForComplication:(CLKComplication *)complication withHandler:(void(^)(CLKComplicationTemplate * __nullable complicationTemplate))handler {
// This method will be called once per supported complication, and the results will be cached
if(complication.family == CLKComplicationFamilyModularSmall) {
CLKComplicationTemplateModularSmallSimpleText* template = [[CLKComplicationTemplateModularSmallSimpleText alloc] init];
template.textProvider = [CLKSimpleTextProvider textProviderWithText:@"10.000"];
handler(template);
} else if(complication.family == CLKComplicationFamilyModularLarge) {
CLKComplicationTemplateModularLargeTallBody* template = [[CLKComplicationTemplateModularLargeTallBody alloc] init];
template.headerTextProvider =[CLKSimpleTextProvider textProviderWithText:@"Header"];
template.bodyTextProvider = [CLKSimpleTextProvider textProviderWithText:@"test"];
handler(template);
} else {
handler(nil);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.