Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

304
Views
How set white color text in Modular Large Complication?

I can't set white text color for body1TextProvider and body2TextProvider. Only grey color available.

My code:

let modularLarge = CLKComplicationTemplateModularLargeStandardBody()
modularLarge.headerTextProvider = CLKSimpleTextProvider(text: dateText.capitalized)
modularLarge.headerTextProvider.tintColor = self.tintColor

modularLarge.body1TextProvider = CLKSimpleTextProvider(text: timeText)
modularLarge.body2TextProvider = CLKSimpleTextProvider(text: "00:00")

modularLarge.body1TextProvider.tintColor = self.whiteColor
modularLarge.body2TextProvider?.tintColor = self.whiteColor

handler(CLKComplicationTimelineEntry(date: Date(),complicationTemplate: modularLarge))

enter image description here

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Looks to me as though there is either a bug, or some undocumented nuance to applying tintColor on CLKSimpleTextProvider.

As per documentation on CLKSimpleTextProvider's tintColor:

tintColor

The tint color to use for text.

Discussion

On clock faces that support custom colors, this color is applied to the text in your text provider.

Ref: https://developer.apple.com/documentation/clockkit/clktextprovider/1627929-tintcolor

Now... after choosing the multi-color Modular watch face, we can observe that the headerTextProvider.tintColor works as documented and does apply the specified UIColor.
but...
body1TextProvider.tintColor and body2TextProvider?.tintColor does not work as documented as it does not apply the given UIColor.
Showing us that the documented behavior is not applied uniformly across all textProviders.


However...

I noticed that if you set the CLKComplicationTemplate's tintColor to something, then body1TextProvider and body2TextProvider become white, even if you're trying to set another color like blue/yellow/etc.

Luckily, you want it white so simply modularLarge.tintColor = .red (or a UIColor matching your theme) will get you your white body texts.


Summary:

No need to do the following (remove/keep, doesn't matter):

modularLarge.body1TextProvider.tintColor = self.whiteColor
modularLarge.body2TextProvider?.tintColor = self.whiteColor

Instead, do this before calling handler:

modularLarge.tintColor = UIColor.red

Solution:

let modularLarge = CLKComplicationTemplateModularLargeStandardBody()    
modularLarge.tintColor = .red //do this

modularLarge.headerTextProvider = CLKSimpleTextProvider(text: dateText.capitalized)
modularLarge.headerTextProvider.tintColor = self.tintColor

modularLarge.body1TextProvider = CLKSimpleTextProvider(text: timeText)
modularLarge.body2TextProvider = CLKSimpleTextProvider(text: "00:00")

handler(CLKComplicationTimelineEntry(date: Date(),complicationTemplate: modularLarge))
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!