Are SwiftUI complications only supported in some complication families?

My apps support almost all complication families.

I'm looking for ways to improve all my existing complications and design new ones considering the new features in watchOS 7, especially with custom designs using SwiftUI.

However, I'm confused about SwiftUI support across different complication families.

Is it possible to use SwiftUI to build a custom complication that takes up the entire space allocated to the complication family for all complication families?

Based on this session, I see that I can use CLKComplicationTemplateGraphicRectangularFullView, for example, along with edgesIgnoringSafeArea, to define a fully custom view that takes up the entire area allocated to a Graphic Rectangular family complication.

However, I am not seeing analogous classes available for other families. For example, most users of my app use the Graphic Corner complication family. There are three new classes I see for that family:
  • CLKComplicationTemplateGraphicCornerGaugeView

  • CLKComplicationTemplateGraphicCornerCircularView

  • CLKComplicationTemplateGraphicCornerTextView

None of these new classes seems to allow replacing the entire area allocated to a Graphic Corner template to a SwiftUI View like CLKComplicationTemplateGraphicRectangularFullView does. Does that mean it's not possible to use SwiftUI to build custom complications for many families?

CLKComplicationTemplateGraphicCornerCircularView seems the closest, but only takes up a small portion of the Graphic Corner space, so it's not a good fit for my apps, which use gauges for this family.

CLKComplicationTemplateGraphicCornerGaugeView has nowhere to provide a View, but does accept a Label, however this is very limited and based on my testing is extremely buggy and doesn't actually work. It doesn't seem to allow for any more customization than CLKComplicationTemplateGraphicCornerGaugeText did, except maybe to add one SF Symbol, if it were working correctly.

Are SwiftUI complications limited to only a subset of complication families? And if so, is there any documentation that shows which ones are supported?

Also, since I said CLKComplicationTemplateGraphicCornerGaugeView is not working, here's my example code with an attempt to use it with a Label:

Code Block
struct Complication_Previews: PreviewProvider {
    static let gaugeProvider = CLKSimpleGaugeProvider(
        style: .fill,
        gaugeColor: .white,
        fillFraction: 0.69)
    static var previews: some View {
        CLKComplicationTemplateGraphicCornerGaugeView(
            gaugeProvider: gaugeProvider,
            label: Label("Test",
                         systemImage: "iphone"))
            .previewContext()
    }
}


I can't seem to attach an image here, but if you run that code the preview will show the iPhone SF Symbol then "..." because the Test text gets truncated.
Answered by Frameworks Engineer in 622466022
The SwiftUI Complications are available for the Graphic Corner, Graphic Circular, Graphic Bezel, Graphic Rectangular, and Graphic Extra Large families (https://developer.apple.com/documentation/clockkit/graphic).

It sounds like the issue you're running into isn't support for the family, but rather the content of the Label being too large for the area. The area available for the SwiftUI View in a CLKComplicationTemplateGraphicCornerGaugeView is fairly small. As a reference, look at the size of the image in the Graphic Corner Gauge image in the Complications Human Interface Guidelines.

You may need to use less (or no text) or a smaller font.
Accepted Answer
The SwiftUI Complications are available for the Graphic Corner, Graphic Circular, Graphic Bezel, Graphic Rectangular, and Graphic Extra Large families (https://developer.apple.com/documentation/clockkit/graphic).

It sounds like the issue you're running into isn't support for the family, but rather the content of the Label being too large for the area. The area available for the SwiftUI View in a CLKComplicationTemplateGraphicCornerGaugeView is fairly small. As a reference, look at the size of the image in the Graphic Corner Gauge image in the Complications Human Interface Guidelines.

You may need to use less (or no text) or a smaller font.
Are SwiftUI complications only supported in some complication families?
 
 
Q