My App is presenting some score results and I would like to add a color variation of score labels from red to green according to the result :
self.scoreLabel.text = "\(total100)/100"
What is the easiest way to realize it ?
Thank you in advance
Call this function when result change.
func setTextColor(score: Int){
if score < 34 {
self.scoreLabel.textColor = .red
}else {
self.scoreLabel.textColor = .green
}
}