title: Swift. Make a NSTimer keep running after the app is closed
body: <p>Okay I am building an app where you have 6 lives, when you die you have to wait 2 minutes to get new lives, heres what I have until now:</p>
  
  <pre><code>var timeLeft = 120
  var countDownTime = NSTimer()
  
  func died() {
      countDownTime = NSTimer.scheduledTimerWithTimeInterval(0.1, target: self, selector: ("updateTimer"), userInfo: nil, repeats: true)
  }
  
  func updateTimer() {
      timeLeft--
      if timeLeft == 0 {
          stopTimer()
      }
  }
  
  func stopTimer() {
      countDownTime.invalidate()
      timeLeft = 120
  }
  </code></pre>
  
  <p>My question is how do i keep this timer running, so when i close and open my app, the timer has kept running?</p>
  
  <p>sorry if this is a duplicate question, I just haven't been able to get an answer to my question.</p>