I am trying to change the colour of text in watch app complication (Modular large tall body), but whatever I do, the text stays white.
Here's my code, of the lines that include tintColor, I've tried them together and each of them one by one.
let secondTemplate = CLKComplicationTemplateModularLargeTallBody()
secondTemplate.tintColor = UIColor.greenColor()
secondTemplate.headerTextProvider.tintColor = UIColor.greenColor()
secondTemplate.bodyTextProvider.tintColor = UIColor.greenColor()
secondTemplate.headerTextProvider = CLKSimpleTextProvider(text: location.uppercaseString)
secondTemplate.bodyTextProvider = CLKSimpleTextProvider(text: "It's 4:20")
let secondEntry = CLKComplicationTimelineEntry(date: dateOf420, complicationTemplate: secondTemplate)
entries.append(secondEntry)
I've looked for questions involving CLKComplication tint color, but I didn't find anything, I hope you can help!
Unfortunately, the answers here are misleading ... I refused to take "only gray is available" as an answer, so the experimentations began:
Yes, this is my app running with full color and white text for the body. Here is the relevant code:
let headerTextProvider = CLKSimpleTextProvider(text: data.headerText)
headerTextProvider.tintColor = UIColor.yellowColor() // data.headerColor
let textProvider = CLKTimeTextProvider(date: data.date)
let template: CLKComplicationTemplate
switch family {
...
case .ModularLarge:
let textTemplate = CLKComplicationTemplateModularLargeTallBody()
textTemplate.headerTextProvider = headerTextProvider
textTemplate.bodyTextProvider = textProvider
template = textTemplate
}
template.tintColor = UIColor(red: 0.99, green: 0.99, blue: 0.99, alpha: 1)
return template
Don't ... I have no idea why this even works, but it sure smells like a bug. Could be the colorspace, could be hack, ... we mortals will never now.
There are other important changes you should have to know about the tint colors for complications with public watchOS2.
You can't customize tint for Utility Face. Only Modular with Multi Color can be tinted.
You can't customize tints for all elements on complication except elements that are designed to be tinted. For instance, with ModularLargeTallBody
or ModularLargeStandardBody
You can customize tint for only header text provider. Other tints of elements will ignored and will be shown as gray.
What if you give tintColor
to template itself, It will be used as tapping feedback color(It is totally wrong documented by Apple), and it also makes elements that are not tinted in complication to bright white color instead of gray.
It's reasonable behavior IMO, however the Apple's documentation is not reasonable.
Tint colors in complications are currently only used in two places:
Elsewhere, the complication will use the face’s tint color.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With