title: Working with NSDate components in Swift
body: <p>I have a date that I need to split in some components. for example</p>
  
  <pre><code>let components = NSCalendarUnit.CalendarUnitDay | NSCalendarUnit.CalendarUnitHour
  let date = calendar.components(components, fromDate: aDate, toDate: NSDate(), options: nil)
  var dateToPrint = "\(date.day) days  \(date.hour) hours"
  </code></pre>
  
  <p>dateToPrint will be the number of days and hours from aDate to now. But if i want the number of weeks instead of days</p>
  
  <pre><code>let components = NSCalendarUnit.CalendarUnitWeek | NSCalendarUnit.CalendarUnitHour
  let date = calendar.components(components, fromDate: aDate, toDate: NSDate(), options: nil)
  var dateToPrint = "\(date.week) weeks \(date.hour) hours"
  </code></pre>
  
  <p>date.week does not exist. So how I could resolve this?</p>