I am working on the watch complication for my app. The app main feature is to time tracking some tasks. So for .graphicCircular
module, I choose to use the graphic circular open gauge template. CLKComplicationTemplateGraphicCircularOpenGaugeSimpleText
. However, the result looks like below. The count down doesn't fit.
Here is the code I am using: (I have not yet hooked up with my model. Just using some placeholder for UI to try to make it looked correct first.)
let relativeProvider = CLKRelativeDateTextProvider(date: Date(), style: .timer, units: [.minute])
let template = CLKComplicationTemplateGraphicCircularOpenGaugeSimpleText()
template.centerTextProvider = relativeProvider
template.bottomTextProvider = CLKSimpleTextProvider(text: "Q", shortText: "Q")
let endDate = Calendar.current.date(byAdding: .minute, value: 1, to: Date()) ?? Date()
let gaugeProvider = CLKTimeIntervalGaugeProvider(style: .fill, gaugeColors: [UIColor.green, UIColor.yellow, UIColor.orange, UIColor.red], gaugeColorLocations: nil, start: dateUsed, end: endDate)
template.gaugeProvider = gaugeProvider
return template
I also tried different style options for relative date text provider, all of them not fit at all.
How can I make this count down fit? (The iOS timer app has the count down inside a circle and it fits. How can it do that?)
If I cannot make the text smaller so it can fit, then how can I then refactor the text from the relative date text provider so I can let it display the counting number only? Meaning instead of 0:11 it uses 11 so it can fit. I know that .offsetShort
provides 11 min
.... Unfortunately, this doesn't fit as well. I can only see 11 ...
on the screen
Any hint appreciates. Thanks so much for all your help.