所以,我对 ClockKit Complications 有点陌生,我想知道如何为两个 Complications 制作占位符模板。
我的代码:
func getPlaceholderTemplateForComplication(complication: CLKComplication, withHandler handler: (CLKComplicationTemplate?) -> Void) {
// This method will be called once per supported complication, and the results will be cached
let template = CLKComplicationTemplateModularLargeStandardBody()
template.headerTextProvider = CLKTimeIntervalTextProvider(startDate: NSDate(), endDate: NSDate())
template.body1TextProvider = CLKSimpleTextProvider(text: "Label 1", shortText: "1")
template.body2TextProvider = CLKSimpleTextProvider(text: "Label 2", shortText: 2)
handler(template)
}
有谁能帮忙吗?