title: how to sort JSON string alphabetically in swift?
body: <p>I am using SwiftyJSON to parse the JSON from web, and then displaying those values in a tableView. I want to add a functionality to sort the data alphabetically ascending or descending according to the user names. I am new to Swift and having trouble sorting this. I would appreciate any help!  </p>
  
  <pre><code>override func viewDidLoad(){
  super.viewDidLoad()
  getContactListJSON()
  }
  
  func getContactListJSON(){
  let urlString = "http://jsonplaceholder.typicode.com/users"
  let urlEncodedString = urlString.stringByAddingPercentEscapesUsingEncoding(NSUTF8StringEncoding)
  let url = NSURL( string: urlEncodedString!)
  var task = NSURLSession.sharedSession().dataTaskWithURL(url!) {(data, response, innerError) in
  self.json = JSON(data: data)
  self.contactsArray = json.arrayValue
  
  dispatch_async(dispatch_get_main_queue(), {
  
  }
   task.resume()
  }
  </code></pre>
  
  <p>This is how I am populating my tableView.</p>
  
  <pre><code> override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -&gt; UITableViewCell {
  
      var cell = tableView.dequeueReusableCellWithIdentifier("Cell", forIndexPath: indexPath) as? UITableViewCell
  
      if cell == nil {
          cell = UITableViewCell(style: UITableViewCellStyle.Value2, reuseIdentifier: "Cell")
      }
  
      cell!.textLabel?.text = self.contactsArray[indexPath.row]["name"].stringValue
      cell!.detailTextLabel?.text = self.contactsArray[indexPath.row]["email"].stringValue
     return cell!
  
  }
  </code></pre>