BelkaLab / GaugeView

A simple Gauge View in Swift
MIT License
54 stars 17 forks source link

Change GaugeColor after viewDidLoad #1

Closed lisardo closed 8 years ago

lisardo commented 8 years ago

Hi BelkaLab,

I want change GaugeColor property when user clicks a button. My code looks like this:

@IBAction func didSelect(sender: UIButton) {
  self.gaugeView.gaugeColor = UIColor.brownColor()
}

But the color won't change. Any suggestions?

lisardo commented 8 years ago

I was able to hack a solution by using setNeedsDisplay() and changing percentage

self.gaugeView.gaugeColor = color
self.gaugeView.setNeedsDisplay()
self.gaugeView.percentage += 0.01

But I don't think this the best way to solve it.

GnuRant commented 8 years ago

Hi lisardo, thanks for the report. I will check the code as soon as possibile in order to fix the issue.