title: Swift cycle which compare times
body: <p>i have a schedule time and current time. I should write cycle which compare times. Cycle should print or send notification when schedule time equals to current time.</p>
  
  <pre><code>var schedule : String = "12.22.00"
  let formatter = DateFormatter()
  formatter.dateFormat = "HH.mm.ss"
  let calendar = Calendar.current
  let minutesago = calendar.date(byAdding: .minute, value: +2, to: Date())!
  let res = formatter.string(from: minutesago)
  
  while true {
      if res == schedule {
          notificate()
          print("isequl")
      }
  }
  </code></pre>