I'm developing some clockkit complications in objective-c using ios 9.2 and xcode 7.2
I've watched a great video here https://developer.apple.com/videos/play/wwdc2015-209/ and found a couple of helpful articles. In this video, and also in the articles, it is stated that the following code in the Complications Controller is all that is needed for static / placeholder complications.
Has something changed, or am I missing something more fundamental here? With the following code in place, I can see my complication for selection, however it is blank / null.
Any ideas? I could go on to implement the other delegates, however was hoping to achieve this step first.
- (void)getPlaceholderTemplateForComplication:(CLKComplication *)complication withHandler:(void(^)(CLKComplicationTemplate * __nullable complicationTemplate))handler {
if (complication.family == CLKComplicationFamilyCircularSmall){
CLKComplicationTemplateCircularSmallRingText *tmpl = [[CLKComplicationTemplateCircularSmallRingText alloc] init];
tmpl.textProvider = [CLKSimpleTextProvider textProviderWithText:@"Title Text"];
tmpl.fillFraction = 0.07f;
tmpl.ringStyle = CLKComplicationRingStyleClosed;
handler(tmpl);
} else if (complication.family == CLKComplicationFamilyModularLarge){
CLKComplicationTemplateModularLargeStandardBody *template = [[CLKComplicationTemplateModularLargeStandardBody alloc] init];
template.headerTextProvider = [CLKSimpleTextProvider textProviderWithText:@"Title Text"];
template.body1TextProvider = [CLKSimpleTextProvider textProviderWithText:@"Body Text"];
handler(template);
}