change button background color on click- WatchKit

1.7k views Asked by At

Button background is initially white with no background. Need the background to change to the following hex value: #cd9037

@IBOutlet weak var zeroTapped: WKInterfaceButton!
@IBAction func ZeroTapped() {
    zeroTapped.setBackgroundColor(UIColor(red: 205, green: 144, blue: 55,alpha: 1.0 ))
    var time = dispatch_time(DISPATCH_TIME_NOW, TIMEOUT)
    dispatch_after(time, dispatch_get_main_queue(), {
        self.appendValue(0)
    })
}

Any body suggest why the following isn't working? Double checked RGI values.

1

There are 1 answers

0
John On

The problem has been resolved: self was missing.

self.zeroTapped.setBackgroundColor(...)