I have an app that's been around since iOS 8. the way it's working is that you have a UITableView and tap on cells to produce a score, depending on the score 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's called everytime the table view is tapped with this :
func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
thing is, it always worked ever since I built the App, but on iOS 10, it doesn't. simply put the color does not change...
Any Help would be appreciated
I was able to solve it, it's changed to this : BarTintColor, found it myself couldn't find anything in apple docs mentionning it
Use it like this : self.toolbar.barTintColor
edit : there is sometinhg mentionning it now in the GM release docs, see answer bellow
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