title: Time comparisons in swift
body: <p>Question:</p>
  
  <p>I need to compare 2 times - the current time and a set one. If the set time is in the future, find out how many minutes remain until said future time.</p>
  
  <p>Other Info:</p>
  
  <p>I am currently using</p>
  
  <pre><code>let date = NSDate()
  let calendar = NSCalendar.currentCalendar()
  let components = calendar.components(.CalendarUnitHour | .CalendarUnitMinute, fromDate: date)
  let hour = components.hour
  let minutes = components.minute
  </code></pre>
  
  <p>which I stole from another answer on SO about how to get the current time in Int format. I then split the future time into hour (Int) and minutes(Int) and compare those... But that gets odd when you go over the hour barrier.</p>