If I want to add a function as fast as the timer hits 0. Do anyone have any tips? Here is the Code that I want to implement it in.
class ViewController: UIViewController {
@IBOutlet weak var Counterlabel: UILabel!
var Nbr = 51
var timerValue = 52
var timer = NSTimer()
override func viewDidLoad() {
super.viewDidLoad()
let timer = NSTimer.scheduledTimerWithTimeInterval(1, target: self, selector: Selector("Counter"), userInfo: nil, repeats: true)
}
@IBAction func Btn1(sender: AnyObject) {
Nbr = timerValue - 1
timerValue = timerValue - 1;
}
func Counter(){
Nbr -= 1
Counterlabel.text = "\(Nbr)"
}
}