The below link is my code for StopWatch app. I have done everything is perfect. But when i press on PAUSE button timer is stopping, to restart again I am going to click START button. But at that time timer runs from starting not from where the pause button stops. Please advice me to resolve this issue. import UIKit
@IBAction func Play(sender: AnyObject) {
timer = NSTimer.scheduledTimerWithTimeInterval(0.01, target: self, selector: Selector("increment"), userInfo: nil, repeats: true)
startTime = NSDate.timeIntervalSinceReferenceDate()
}
@IBAction func Pause(sender: AnyObject) {
timer.invalidate()
}
@IBAction func Stop(sender: AnyObject) {
timer.invalidate()
time = 0
resultLabel.text = "\(0):\(0):\(0):\(0)"
}