1
因此,我對ClockKit Complications有點新了,我想知道如何爲兩個併發症製作佔位符模板。如何定義CLKComplicationDataSource中的兩個併發症的數據
我儘量代碼:
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)
}
任何人能幫助我們嗎?