title: Swift 2.0+ finding the day of the week a month starts
body: <p>I am using Swift 2.0+ and need it to be compatible with iOS 8.0+.  I want to find out what day of the week a month starts. For example, November 15 would return Sunday, December 15 would return Tuesday, and January 16 would return Friday.  I think the best approach would be to get the current day of the week and day of the month then count backwards until you reach 1 and get that day.  Currently I have</p>
  
  <pre><code>// Returns the day of the week as an integer 1 being Sunday and 7 being Saturday
  func dayOfWeek() -&gt; Int {
          let components = calender.component(NSCalendarUnit.Weekday, fromDate: t)
          return components
      }
  </code></pre>
  
  <p>Which calculates the current day of the week, after that I hit a roadblock.</p>