I have an application that has been since iOS 8. the way it works is that you have a UITableView and click on the cells to create a rating, depending on the rating, the UItoolbar at the bottom changes color using this method:
func updateToolbarAndLabel(score: Int) {
if(score <= -1) {
self.toolbar.backgroundColor = UIColor.greenColor()
} else if(score <= 0) {
self.toolbar.backgroundColor = .None
} else if(score <= 9) {
self.toolbar.backgroundColor = UIColor.greenColor()
} else if(score <= 29) {
self.toolbar.backgroundColor = UIColor.yellowColor()
} else if(score >= 30) {
self.toolbar.backgroundColor = UIColor.redColor()
}
if (score <= 0) {
self.scoreshow.text = "0"
} else {
self.scoreshow.text = (score as NSNumber).stringValue }
}
then it is called every time the table view looks like this:
func tableView (tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
thing, it always worked since I built the application, but on iOS 10 it is not. just put the color will not change ...
Any help would be appreciated
source
share