tenSlider
is going to change the currentBPM
value by 10 and pass its result to bpmLabel. This works fine.
However, I also want the onesSlider
update that same label, but instead by +1 or -1.
The problem is that it doesn't check the current value and update that value. Instead it just updates its own value and passes it to the bpmLabel
.
Anyone know how to connect the two?
import WatchKit
import Foundation
class InterfaceController: WKInterfaceController {
@IBOutlet var bpmLabel: WKInterfaceLabel!
@IBOutlet var tenSlider: WKInterfaceSlider!
@IBOutlet var onesSlider: WKInterfaceSlider!
var currentBPM = Int()
@IBAction func tenSliderDidChange(value: Int) {
currentBPM = value
updateLabel()
}
@IBAction func onesSliderDidChange(value: Int) {
currentBPM = value
updateLabel()
}
func updateLabel() {
bpmLabel.setText("\(currentBPM)")
}