Hello everyone,
I'm having trouble understanding when getLocalizableSampleTemplate() will be called in production apps. During development, this method is called several times a day for me, even if I don't run a new build on my Watch.
My app has several complications updates througout the day using
server.reloadTimeline(for: complication)
but calling reloadtimeline does not necessarily trigger "getLocalizableSampleTemplate()" calls.
Per documentation: https://developer.apple.com/documentation/clockkit/clkcomplicationdatasource/1650686-getlocalizablesampletemplate
"The system calls this method once per supported complication when your extension is installed, and the results are cached"
I have some logs that show the app appears to crash when this method is called in some circumstances. However, I don't get a crash report nor has it ever crashed when the debugger has been active. I'm trying to get a better understanding of this method.
An example last line of log before crash hits this code:
case .circularSmall:
let localComp = CLKComplicationTemplateCircularSmallSimpleImage()
let imageName = "Complication/Circular"
let image = UIImage.init(named: imageName)
if image != nil {
localComp.imageProvider = CLKImageProvider.init(onePieceImage: image!)
}
else {
handler(nil)
return
}
builtComp = localComp
handler(builtComp)
any insight would be appreciated!