I'm trying to create a simple stopwatch app where the timer
label increments when the startButton
button is pressed. This is what I have:
@IBOutlet weak var timer: UILabel!
@IBAction func startButton(sender: AnyObject) {
timer = NSTimer.scheduledTimerWithTimeInterval(0.0025, target: self, selector: Selector("result"), userInfo: nil, repeats: true)
}
var count = 0
func result() {
count++
timer.text=String(count)
}
I get the error "Extra argument 'selector' in call" but can't workout the syntax to do it properly.