title: Stopwatch Lap Timer
body: <p>I have created a simple stopwatch following a tutorial on Youtube but I have found that pressing the 'lap' button just gives me the current time the timer is at. </p>
  
  <p>The only way I can think of doing this is having a timer running in the background that prints the time the button is pressed but resets after that.</p>
  
  <p>Is there an easier way?!</p>
  
  <p>This is the first project I have done and I am still getting to grips the with basics. </p>
  
  <p>Here's the lap-related code:</p>
  
  <p>@IBAction func lapReset(sender: AnyObject) {</p>
  
  <pre><code>    if addLap == true {
  
          laps.insert(stopwatchString, atIndex: 0)
          lapsTableView.reloadData()
  
  
      }else {
  
          addLap = false
  
          lapresetButton.setImage(UIImage(named: "lapButton.png"), forState: .Normal)
  
          laps.removeAll(keepCapacity: false)
          lapsTableView.reloadData()
  
  
          fractions = 0
          seconds = 0
          minutes = 0
  
          stopwatchString = "00:00.00"
          stopwatchLabel.text = stopwatchString
  
  
      }
  
  
  }
  </code></pre>
  
  <p>Thanks,
  Mike</p>