Build complications in SwiftUI: Complications built with SwiftUI are missing from the project

Hello! 👋🏼

I watched the Build complications in SwiftUI session yesterday and I wanted to take a look at the code as well. I downloaded the sample project and searched for the complications as well as views like History, I couldn't find anything.

Are you planning to add those things to the project?

Thank you, I absolutely loved the session.
Answered by Frameworks Engineer in 616167022
Thanks for your feedback on the session!

The SwiftUI complications created during the session's demo aren't currently in that sample code. If you'd like to see those included, please send us your feedback via Feedback Assistant (choose Developer Tools, then Sample Code under the problem area).
Accepted Answer
Thanks for your feedback on the session!

The SwiftUI complications created during the session's demo aren't currently in that sample code. If you'd like to see those included, please send us your feedback via Feedback Assistant (choose Developer Tools, then Sample Code under the problem area).
Thank you, I will do just that. Is it ok if I post the number case here after I filed it so it will be easier for you to check it out?
Along this same thread the Coffee Tracker sample app's complication code is set for a deployment target of watchOS 6.2 and this is a code block for a complication from the sample;

Code Block
// Return a circular small template.
    private func createCircularSmallTemplate(forDate date: Date) -> CLKComplicationTemplate {
        // Create the data providers.
        let mgCaffeineProvider = CLKSimpleTextProvider(text: data.mgCaffeineString(atDate: date))
        let mgUnitProvider = CLKSimpleTextProvider(text: "mg Caffeine", shortText: "mg")
        
        // Create the template using the providers.
        let template = CLKComplicationTemplateCircularSmallStackText()
        template.line1TextProvider = mgCaffeineProvider
        template.line2TextProvider = mgUnitProvider
        return template
    }

Changing the deployment target to watchOS 7.0 will produce this error:
'init()' was deprecated in watchOS 7.0: Initializing a template without parameters is deprecated in watchOS 7.0. Use an init with parameters instead.

I have set up my own complications to supposedly align with the new init() requirements, however my complication is not showing up in the list of available options. Have I done something incorrect in this example?

Thank you - Dan

Code Block
func getLocalizableSampleTemplate(for complication: CLKComplication, withHandler handler: @escaping (CLKComplicationTemplate?) -> Void) {
        switch complication.family {
case .circularSmall:
let line1 = CLKSimpleTextProvider(text: "Run Roster")
let line2 = CLKSimpleTextProvider(text: "10 Sep 2021")
let circularSmall = CLKComplicationTemplateCircularSmallStackText(line1TextProvider: line1, line2TextProvider: line2)
handler(circularSmall)
... // more switch cases below.




@DanOLeary I think it would be a better idea to submit a separate question for it. It's better to keep threads as focused as possible.
Any update on this? I'm also looking for the code used in the WWDC video
Build complications in SwiftUI: Complications built with SwiftUI are missing from the project
 
 
Q