3

I have several complications for watchOS 5 and Apple Watch Series 4 that aren't properly making use of their tintColor. Instead, they just display with white text. Other 3rd party complications on the same face show their color.

Is there a trick other than using tintColor on the leadingTextProvider and trailingTextProvider of a Graphic Circular complication?

I'm using Objective-C in case that matters here.

Koraktor
  • 35,732
  • 8
  • 65
  • 94
RealCasually
  • 3,441
  • 3
  • 23
  • 32
  • It seems that only native complications can have their own color. So there is no way to use colored text without using private API. You said that there were third party complications that showed their color. Can you name one? – Owen Zhao Sep 23 '19 at 19:34
  • I know how to do that. Just see my new posts. – Owen Zhao Sep 24 '19 at 09:32

2 Answers2

1

You can do that with CLKSimpleTextProvider, the trick thing is that you can't do it with CLKTextProvider.

For example,

t.leadingTextProvider =  {
    let t = CLKSimpleTextProvider(text: String(6))
    t.tintColor = .red

    return t
}()

works

t.leadingTextProvider =  {
    let t = CLKTextProvider(format: String(6))
    t.tintColor = .red

    return t
}()

doesn't work.

In Apple's Documents of CLKTextProvider, it says

You do not create instances of this class yourself. Instead, you create instances of an appropriate subclass, based on the type of text data you are trying to create. You can also use the textProviderWithFormat: class method to create a generic text provider constructed from a format string and the data from other text provider.

Besides, you also need a watch face that allows tint color, like mine.

enter image description here

Xcode 11.0 (11A420a) watchOS simulator 6.0

Owen Zhao
  • 2,827
  • 1
  • 20
  • 41
0

Is it possible that you‘re initializing your UIColor incorrectly? Can you show the relevant code?

A common mistake is using integers (e.g. 0-255) for the RGB values of UIColor (see this question).

Koraktor
  • 35,732
  • 8
  • 65
  • 94