我们如何在 Swift 中使用 NSDate 对动态 UITable 进行排序和分段(排序)?

How can we order and section (sort) dynamic UITable with NSDate in Swift?

我想知道是否有任何方法可以在 Swift 中使用 NSDate 对动态 UITable 进行排序和分段? (从现在到过去)

例如,我想要这样的动态 table:

Section: 2015-06-04
2015-06-04 23:16:24
2015-06-04 22:46:23
2015-06-04 21:03:45

Section: 2015-06-02
2015-06-02 18:34:23
2015-06-02 12:05:45

Section: 2015-06-01
2015-06-01 07:34:23
2015-06-01 06:05:41

谢谢! :)

NSDate 符合 compare: 选择器,因此使用其中一种排序方法对后备 mutable 数组进行排序并重新加载 table 数据