title: Sort NSArray of NSDictionary objects in Swift
body: <p>I have retrieved some JSON data from an API and now have an NSArray full of NSDictionary objects. Each NSDictionary has a key/value pair of "name" and I want to sort the NSArray by that key/value pair.</p>
  
  <p>I've done quite a bit of searching but none of the solutions I've come across seem to work in the new Swift language and I'm not sure if it's possibly a bug or not...</p>
  
  <p>I've tried:</p>
  
  <pre><code>var descriptor: NSSortDescriptor = NSSortDescriptor(key: "name", ascending: true)
  var sortedResults: NSArray = results.sortedArrayUsingDescriptors(NSSortDescriptor(key: "name", ascending: true))
  </code></pre>
  
  <p>But that won't compile stating "NSSortDescriptor is not convertible to [AnyObject]".</p>
  
  <p>Any advice?</p>