title: Swift 2 - Sort Dictionary with NSDate()-Keys
body: <p>I want to sort this kind of Dictionary:</p>
  
  <pre><code>var data = [NSDate: [String: AnyObject]]()
  </code></pre>
  
  <p>e.g.</p>
  
  <pre><code>data: [2015-08-29 12:08:29 +0000: ["foo": "bar"]], 
        [2015-08-29 12:05:13 +0000: ["foo": "bar"]], 
        [2015-08-29 12:11:02 +0000: ["foo": "bar"]]
  </code></pre>
  
  <p>should then be:</p>
  
  <pre><code>dataSorted: [2015-08-29 12:05:13 +0000: ["foo": "bar"]], 
              [2015-08-29 12:08:29 +0000: ["foo": "bar"]], 
              [2015-08-29 12:11:02 +0000: ["foo": "bar"]]
  </code></pre>
  
  <p>I tried:</p>
  
  <pre><code>let dataSorted = Array(data.keys).sorted(&lt;)
  // Could not find an overload for '&lt;' that accepts the supplied arguments
  </code></pre>
  
  <p>and</p>
  
  <pre><code>let dataSorted = sorted(data) { $0.0 &lt; $1.0 }
  // Could not find member '0'
  </code></pre>