Swift: Sort Array by sort descriptors

后端 未结 3 622
长发绾君心
长发绾君心 2020-12-30 03:51

I am using coredata so I need sort descriptors for my entities

For example, a Coordinate-entity has this class func:

class func sortDescriptors() -&g         


        
3条回答
  •  别那么骄傲
    2020-12-30 04:30

    Another approach to the nice extensions of Damien could be a multi-cast.

    myArray = (myArray as NSArray).sortedArrayUsingDescriptors(tableView.sortDescriptors) as! Array
    

    Original source: NSHipster

提交回复
热议问题