title: How to stop a timer countdown at 0. Swift
body: <p>Does anyone know how I can tell the timer to stop when it reaches 0. Right now it keeps counting down below zero. </p>
  
  <pre><code>import UIKit
  
  class ViewController: UIViewController {
      var timerCount = 20
      var timerRunning = false
      var timer = NSTimer()
  
      @IBOutlet weak var timerLabel: UILabel!
  
      func Counting() {
          timerCount -= 1
          timerLabel.text = "\(timerCount)"
      }
  
      @IBAction func startButton(sender: UIButton) {
          if timerRunning == false {
              timer = NSTimer.scheduledTimerWithTimeInterval(1, target: self, selector: Selector ("Counting"), userInfo: nil, repeats: true)
              timerRunning = true
          }
      }
  
      override func viewDidLoad() {
          super.viewDidLoad()
          // Do any additional setup after loading the view, typically from a nib.
          if timerCount == 0 {
              timerRunning = false
          }
      }
  }
  </code></pre>