Swift 4.0 数组排序(仅记录)

public var sectionArr:Array!
for item in array1 {
            dic .setValue(item, forKey: item as! String)
        }
        sectionArr = NSMutableArray.init(array: dic.allKeys) as! Array
//        sectionArr.sort { (s0, s1) -> ComparisonResult in
//            ComparisonResult.orderedDescending
//        }
        sectionArr = sectionArr.sorted { (s1, s2) -> Bool in
            return s2 as! String > s1 as! String
            }

你可能感兴趣的:(Swift 4.0 数组排序(仅记录))