'getLocalizableSampleTemplate' does not display as expected with Xcode 15.2

17 views Asked by At

When I use Xcode15 create complications with Apple Watch, getLocalizableSampleTemplate not display as expected, how to fix this error?

Expect the code to show the actual effect (without using the WidgetKit framework)

    func getLocalizableSampleTemplate(for complication: CLKComplication, withHandler handler: @escaping (CLKComplicationTemplate?) -> Void) {
        if complication.family == .graphicCircular {
            let template = CLKComplicationTemplateGraphicCircularView(
                Circle()
                    .foregroundColor(Color.red)
            )
            handler(template)
        } else {
            let template = CLKComplicationTemplateGraphicRectangularFullView(
                Circle()
                    .foregroundColor(Color.red)
            )
            handler(template)
        }
    }

screenshot

0

There are 0 answers