Created
April 15, 2019 11:04
-
-
Save itinance/32b5573c04f0ad19861bcd4e21d52ee7 to your computer and use it in GitHub Desktop.
getLocalizableSampleTemplateForComplication
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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