Swift 4.0 数组排序(仅记录)

2017-09-26  本文已影响386人  静花寒
public var sectionArr:Array<Any>!
for item in array1 {
            dic .setValue(item, forKey: item as! String)
        }
        sectionArr = NSMutableArray.init(array: dic.allKeys) as! Array<Any>
//        sectionArr.sort { (s0, s1) -> ComparisonResult in
//            ComparisonResult.orderedDescending
//        }
        sectionArr = sectionArr.sorted { (s1, s2) -> Bool in
            return s2 as! String > s1 as! String
            }
上一篇下一篇

猜你喜欢

热点阅读