How to have a complication to simply display the app name?

I've created an standalone watch app using SwiftUI. I want a complication that just show the app name. I thought the default should work do this? I've not made any change to the ComplitionController:


func getLocalizableSampleTemplate(for complication: CLKComplication, withHandler handler: @escaping (CLKComplicationTemplate?) -> Void) {

// This method will be called once per supported complication, and the results will be cached

handler(nil)

}


I can see my app name in the watch face complication selection list. But it's blank in the watch face itself. Touching it opens my app.


What to do?


Initially. the complication selection show my app as "MyApp WatchKit App", on the watch face it's blank but touching the complication shows "MyApp WatchKit App" briefly and opens my app. I have no idea where the app name settings is in Xcode. I have set all the "Display Name" fields in Xcode as "MyApp". When I changed the "Identity and Type" field from "MyApp WatchKit App" to "MyApp", the compication configure selection list now show "MyApp". But on the watch face, it's still blank. Toching it shows a square shape, then my app open.

Replies

Hard to guess what you did what you did not do.


have you read and followed this ? (not for SwiftUI, but principle should be the same)


https://developer.apple.com/documentation/clockkit/clkcomplicationdatasource