title: Group and Sort TableView by Date
body: <p>i want ask how to grouping data (section) by Date?</p>
  
  <p>there is my code :</p>
  
  <pre><code>import UIKit
  import CoreData
  
  class TableViewController: UITableViewController {
  
  var myList = []
  
  override func viewDidLoad() {
      super.viewDidLoad()
  
  
  }
  
  override func viewDidAppear(animated: Bool) {
      let appDel : AppDelegate = UIApplication.sharedApplication().delegate as! AppDelegate
      let context : NSManagedObjectContext = appDel.managedObjectContext!
  
      let freq = NSFetchRequest(entityName: "Item")
  
      myList = context.executeFetchRequest(freq, error: nil)!
  
      tableView.reloadData()
  }
  
  override func didReceiveMemoryWarning() {
      super.didReceiveMemoryWarning()
  
  }
  
  // MARK: - Table view data source
  
  override func numberOfSectionsInTableView(tableView: UITableView) -&gt; Int {
  
      return 1
  }
  
  override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -&gt; Int {
  
      return myList.count
  }
  
  
  override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -&gt; UITableViewCell {
      let cell = tableView.dequeueReusableCellWithIdentifier("Cell", forIndexPath: indexPath) as! TableViewCell
  
      var object : NSManagedObject = myList[indexPath.row] as! NSManagedObject
  
      let name = object.valueForKeyPath("name") as! String
      let qty = object.valueForKeyPath("qty") as! Int
      let date = object.valueForKeyPath("date") as! String
  
      cell.nameLabel.text = name
      cell.qtyLabel.text = toString(qty)
      cell.dateLabel.text = date
  
      return cell
  }
  
  }
  </code></pre>
  
  <p>in detail : 
  at now my date sample is just row (just 1 section default) 
  example : <br/></p>
  
  <pre><code>apple  1  Jul 10, 2015 (row 1)
  orange 7  Jul 10, 2015 (row 2)
  grape  5  Jul 11, 2015 (row 3)
  </code></pre>
  
  <p>i want grouping by date so this result like : <br/></p>
  
  <pre><code>Jul 11, 2015 (section 1)
      grape 5 (row 1)
  Jul 10, 2015 (section 2)
      apple 1 (row 2)
      orange 7 (row 3)
  </code></pre>
  
  <p>NB : section is dynamic, depends at data, and sorting date descending</p>
  
  <p>anyone have solution? thx before</p>