title: How to automatically disable a button when time is up
body: <pre><code>@IBAction func BtnClickMe(sender: UIButton) {
      timer = Timer.scheduledTimer(timeInterval: 1, target: self, selector: #selector(ViewController.CLOCK), userInfo: nil, repeats: true)
  
  }
  </code></pre>
  
  <p>Here is my clock function when timer is running, stop clock when it reach 0 sec.</p>
  
  <pre><code>@objc func CLOCK(){
      sec = sec - 1
      lbnTime.text = "\(sec)"
      if(sec == 0){
          lbnTime.text = "Time Up"
          timer.invalidate()
          //disable button here
      }
  }
  </code></pre>