title: Timer coutdown between two dates in swift
body: <p>I want to integrate timer between two date one is selected date and another is current date on Button title like any other countdown app.</p>
  
  <pre><code>func countDownDate() {
      var calendar = Calendar.current
      let diffDateComponents = calendar.dateComponents([.day, .hour, .minute, .second], from: self.startDate, to: self.currentDate as Date)
      let countdown = "Days \(String(describing:diffDateComponents.day!)),  Hours: \(String(describing: diffDateComponents.hour!)), Minutes: \(String(describing: diffDateComponents.minute!)), Seconds: \(String(describing: diffDateComponents.second!))"
      print("countdown",countdown)
      var dayText = String(describing: diffDateComponents.day!) + "d "
      var hourText = String(describing: diffDateComponents.hour!) + "h "
      self.button_CreateBid.setTitle(dayText + hourText + String(describing: diffDateComponents.minute!) + "m " + String(describing: diffDateComponents.second!) + "s", for: .normal)
  }
  
  
  let when = DispatchTime.now() + 0.1 // change 2 to desired number of seconds
  DispatchQueue.main.asyncAfter(deadline: when) {
      Timer.scheduledTimer(timeInterval: 0.1, target: self, selector: #selector(ServiceDetailViewController.countDownDate), userInfo: nil, repeats: true)
  }
  </code></pre>