3

I am using the following snippet to show the relative time in a Modular Large complication.

textTemplate.body1TextProvider = [CLKRelativeDateTextProvider
                                     textProviderWithDate:timeOfEntry
                                     style:CLKRelativeDateStyleNatural
                                     units:(NSCalendarUnitMinute)];

Usually (but not always), the relative time is shown correctly the first time, something like,

 42 MIN        (with plenty of room for more text on the same line)

...but soon after, updates appear as show in the screenshot below,

 42 M...       (again, with plenty of room for more text on the same line)

Prematurely constructed text

As shown, it it prematurely truncated with ellipsis and always after the first letter of the time unit (M.. for minutes, H.. for hours).

The body2 line is empty, should it want to overflow (I've even tried setting it to nil, and @"", just to make absolutely sure of that).

The problem appears on the simulator (38mm and 42mm), and on my actual 38mm watch.

If this was a watchos2 bug, I'd expect it to be obvious and fixed by now.

Anyone else seeing this, or know the solution?

Thanks.

Snips
  • 6,575
  • 7
  • 40
  • 64
  • I raised a radar ticket with Apple for this problem, 24021768 "CLKRelativeDateTextProvider text being truncated prematurely" – Snips Jan 20 '16 at 19:44
  • 1
    Did you ever find a solution to this issue? It's still happening to me on watchOS 4. – timschmitz Jan 30 '18 at 16:48
  • I am still seeing this problem on watchOS 6.2.1 when using a 'CLKRelativeDateTextProvider' as the 'centerTextProvider' 'CLKComplicationTemplateGraphicCircularOpenGaugeRangeText'. Submitted a sample project through Feedback Assistant with the ID FB7318087 – gohnjanotis Apr 19 '20 at 02:26

0 Answers0