@@ -46,8 +46,45 @@ extension CLKComplicationTemplate {
4646 timeFormatter. dateStyle = . none
4747 timeFormatter. timeStyle = . short
4848
49+
4950 switch family {
50- case . graphicCorner, . graphicCircular, . graphicRectangular, . graphicBezel:
51+ case . graphicCorner:
52+ // ***************************************
53+ // ** Apple Watch Series 4 Complication **
54+ // ***************************************
55+ // Corner Text
56+ // Outer Text: Current Glucose and Trend
57+ // Inner Text: timeText
58+
59+ if #available( watchOSApplicationExtension 5 . 0 , * ) {
60+ let cornerTemplate = CLKComplicationTemplateGraphicCornerStackText ( )
61+ cornerTemplate. outerTextProvider = glucoseAndTrendText
62+ cornerTemplate. outerTextProvider. tintColor = . green
63+ cornerTemplate. innerTextProvider = timeText
64+ return cornerTemplate
65+ } else {
66+ // Fallback on earlier versions
67+ return nil
68+ }
69+ case . graphicCircular:
70+ // ***************************************
71+ // ** Apple Watch Series 4 Complication **
72+ // ***************************************
73+ // Circular Gauge
74+ // Full Ring
75+ // Current Glucose in Center, Trend Arrow Below
76+ // * future enhancement - update gauge colors to reflect loop status, or time in range for the day
77+ if #available( watchOSApplicationExtension 5 . 0 , * ) {
78+ let circularTemplate = CLKComplicationTemplateGraphicCircularOpenGaugeSimpleText ( )
79+ circularTemplate. gaugeProvider = CLKSimpleGaugeProvider ( style: . fill, gaugeColor: . green, fillFraction: 1 )
80+ circularTemplate. centerTextProvider = CLKSimpleTextProvider ( text: glucoseString)
81+ circularTemplate. bottomTextProvider = CLKSimpleTextProvider ( text: ( trend? . symbol ?? " " ) )
82+ return circularTemplate
83+ } else {
84+ // Fallback on earlier versions
85+ return nil
86+ }
87+ case . graphicRectangular, . graphicBezel:
5188 return nil
5289 case . modularSmall:
5390 let template = CLKComplicationTemplateModularSmallStackText ( )
0 commit comments