Swift 2.0 Sorting Array of Objects by Property

前端 未结 4 1756
隐瞒了意图╮
隐瞒了意图╮ 2020-12-14 14:43

In Swift 2.0, how would you go about sorting an array of custom objects by a property? I know in Swift 1.2, this was done using sorted() and sort(). However, these methods n

4条回答
  •  眼角桃花
    2020-12-14 15:16

    sort is now sortInPlace (or something similar) with the same parameters as sort.

提交回复
热议问题