Hi
I'm trying to set the textColor of a label in background but its not working, the same code works in foreground. In background only the text itself changes, the color stays the same. Can anyone else confirm this?
A few points:
- This is a workout app with workout session started
- Timer runs in background as expected
- textColor remains unchanged
- same code applies in foreground and textColor changes.
- code is being called at the right time but not reflected.
- changeLabel text gets called and applied as expected.
func changeLabels() {
self.setTitle(routineName)
RoutineStateLabel.setText(currentTimerDict["Stage"] as? String)
CountDownLabel.setText(MakeTimeLabel(Int(timer)))
timeRemainingLabel.setText(MakeTimeLabel(timeRemaining))
timeElapsedLabel.setText(MakeTimeLabel(timeElapsed))
}
func changeStageLabelColor() {
if let stage = currentTimerDict["Stage"] as? String {
if stage == "Warm Up" {
RoutineStateLabel.setTextColor(UIColor.yellowColor())
} else if stage.rangeOfString("Round") != nil {
RoutineStateLabel.setTextColor(UIColor.redColor())
} else if stage.rangeOfString("Rest") != nil {
RoutineStateLabel.setTextColor(UIColor.greenColor())
} else if stage == "Cool Down" {
RoutineStateLabel.setTextColor(UIColor.blueColor())
} else if stage == "Quick Timer" {
RoutineStateLabel.setTextColor(UIColor.orangeColor())
} else {
RoutineStateLabel.setTextColor(UIColor.greenColor())
}
}
}