title: How to sort a NSDate in Swift
body: <p>I have an array like this:</p>
  
  <pre><code>selectedMarks : [StatDetails] = [
    StatDetails(dateRanges: [2015-05-29 09:30:00 +0000, 2015-05-29 10:30:00 +0000], hours: 1),
    StatDetails(dateRanges: [2015-06-16 08:00:00 +0000, 2015-06-16 09:00:00 +0000], hours: 1),
    StatDetails(dateRanges: [2015-06-10 15:00:00 +0000, 2015-06-10 16:00:00 +0000], hours: 1)]
  </code></pre>
  
  <p>As you can see, selectedMarks is an array of "StatDetails" that contains 2 parameters:</p>
  
  <p>1: dateRanges": an array of NSDate</p>
  
  <p>2: hours: an Integer</p>
  
  <p>I'm trying to figure out how to sort this array of StatDetails by the first element of the dateRanges array.</p>
  
  <p>I tried with this but no success:</p>
  
  <pre><code>selectedMarks.sortInPlace({ $0.dateRanges &lt; $1.dateRanges })
  </code></pre>
  
  <p>Any help with that??</p>