fix
This commit is contained in:
parent
45b3791922
commit
f513b2b855
|
@ -29,6 +29,10 @@ class ComplicationController: NSObject, CLKComplicationDataSource {
|
||||||
|
|
||||||
func getCurrentTimelineEntry(for complication: CLKComplication, withHandler handler: @escaping (CLKComplicationTimelineEntry?) -> Void) {
|
func getCurrentTimelineEntry(for complication: CLKComplication, withHandler handler: @escaping (CLKComplicationTimelineEntry?) -> Void) {
|
||||||
// Call the handler with the current timeline entry
|
// Call the handler with the current timeline entry
|
||||||
|
if (complication.family == .graphicCorner) {
|
||||||
|
handler(getEntryForGraphicCorner())
|
||||||
|
}
|
||||||
|
|
||||||
handler(nil)
|
handler(nil)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -46,18 +50,22 @@ class ComplicationController: NSObject, CLKComplicationDataSource {
|
||||||
// This method will be called once per supported complication, and the results will be cached
|
// This method will be called once per supported complication, and the results will be cached
|
||||||
|
|
||||||
if (complication.family == .graphicCorner) {
|
if (complication.family == .graphicCorner) {
|
||||||
handler(getTemplateForGraphicCorner())
|
handler(getTemplateForGraphicCorner("Example"))
|
||||||
}
|
}
|
||||||
|
|
||||||
handler(nil)
|
handler(nil)
|
||||||
}
|
}
|
||||||
|
|
||||||
func getTemplateForGraphicCorner() -> CLKComplicationTemplateGraphicCornerStackText {
|
func getEntryForGraphicCorner() -> CLKComplicationTimelineEntry {
|
||||||
|
let gc = getTemplateForGraphicCorner(getFront())
|
||||||
|
return CLKComplicationTimelineEntry(date: Date(), complicationTemplate: gc)
|
||||||
|
}
|
||||||
|
|
||||||
|
func getTemplateForGraphicCorner(_ front: String) -> CLKComplicationTemplateGraphicCornerStackText {
|
||||||
let gc = CLKComplicationTemplateGraphicCornerStackText()
|
let gc = CLKComplicationTemplateGraphicCornerStackText()
|
||||||
let front = "Cadey"
|
|
||||||
let text = CLKSimpleTextProvider()
|
let text = CLKSimpleTextProvider()
|
||||||
text.text = front + " foo"
|
text.text = front
|
||||||
text.shortText = "hi"
|
text.shortText = ""
|
||||||
text.tintColor = UIColor.white
|
text.tintColor = UIColor.white
|
||||||
|
|
||||||
gc.innerTextProvider = text
|
gc.innerTextProvider = text
|
||||||
|
|
Loading…
Reference in New Issue