1
votes

I am testing and able to reproduce this in a very simple app. I am following the WWDC 2015 video: https://developer.apple.com/videos/play/wwdc2015/209/

Another tutorial which uses the same info is: https://www.bignerdranch.com/blog/watchkit-2-complications/

Just like the WWDC video, I want my app to only provide a CLKComplicationTemplateModularLargeStandardBody complication. So in my extension's target general settings, I have enabled ONLY Modular Large.

enter image description here

For a simple test, I only added the code for the placeholders:

- (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
    NSLog(@"getLocalizableSampleTemplateForComplication: %ld",(long)complication.family);

    if (complication.family==CLKComplicationFamilyModularLarge) {
        CLKComplicationTemplateModularLargeStandardBody *template = [[CLKComplicationTemplateModularLargeStandardBody alloc] init];
        template.headerTextProvider=[CLKSimpleTextProvider textProviderWithText:@"Date"];
        template.body1TextProvider=[CLKSimpleTextProvider textProviderWithText:@"Class"];
        template.body2TextProvider=[CLKSimpleTextProvider textProviderWithText:@"Location"];
        handler(template);
    } else {
        handler(nil);
    }
}

After this, I deleted and even reseted both the iPhone and Watch simulator. Then ran the app. In the Watch's customize screen for Infograph Modular watch face, I don't see my app available.

enter image description here

An interesting thing (bug???) I noticed is that if I go to the extension's general settings and enable all the complications, then it shows up.

enter image description here

But I don't want to provide other types of complications. I only want to provide Modular Large for my app. Is this a bug?

Another thing I noticed is that the placeholder shows -------- instead of my provided TextProvider templates. Is this another bug?

I have reset the simulator, deleted my app from watch and iPhone many times to no solution. After resetting, my NSLog for getLocalizableSampleTemplateForComplication does print however the complication doesn't appear in the customize screen.

1
This doesn't help resolve your issue, but I'm also running into this... my complication (Graphic Corner) doesn't appear in the Customize screen and flashes between the complication graphic and the placeholder name of my app during use unless I enable all of the possible complication types in WatchKit Extension > General > Complications Configuration. - Gene Goykhman
@Pranoy C - i m running into the same issue. let us know if u find a solution. - Jay Bhalani
Maybe it is late but lets try to save someone some time. You are using wrong complication family. Instead of CLKComplicationFamilyModularLarge you should use CLKComplicationFamilyGraphicRectangular - Igor P
why can't he use family modular large? - alamodey

1 Answers

-1
votes

The complication family is CLKComplicationFamilyGraphicRectangular for the above watch face. So use that for updating values and placeholder text