title: How to get Monday's date of the current week in swift
body: <p>I'm trying to get Monday's date of the current week. This is treated as the first day of the week in my table view.
  I also need to get Sunday's of the current week. This is treated as the last day of the week in my table view.</p>
  
  <p>Current attempt:</p>
  
  <pre><code>let date = NSDate()
  let calendar = NSCalendar.currentCalendar()
  calendar.firstWeekday = 1
  //attempt to changefirstday
  
  let dateFormatter = NSDateFormatter()
  let theDateFormat = NSDateFormatterStyle.ShortStyle
  let theTimeFormat = NSDateFormatterStyle.ShortStyle
  dateFormatter.dateStyle = theDateFormat
  dateFormatter.timeStyle = theTimeFormat
  
  let currentDateComponents = calendar.components([.YearForWeekOfYear, .WeekOfYear ], fromDate: date)
  let startOfWeek = calendar.dateFromComponents(currentDateComponents)
  print("startOfWeek is \(startOfWeek)")
  let stringDate = dateFormatter.stringFromDate(startOfWeek!)
  print("string date is \(stringDate)") //This is returning Sunday's date
  </code></pre>