我有一个小问题,但我想不通...
我编写了一个关机倒计时代码,我需要在以下代码中重新使用变量名“x”:
@IBAction func valueChange(sender: NSSlider) {
let x = sender.intValue
valueofSlider.stringValue = "\(x)"
}
IBOutlet weak var countDown: NSTextField!
var starter = false;
@IBAction func startCountDown(sender: NSButton) {
starter = true
}
var trigger = 600 //here I put the value myself but i would like
var trigger = (x * 60) //to get the slider value in seconds