Sorting an array based on the value of a property

sort(by:) is probably the easiest right now, other than conforming Foo to Comparable.

sort { $0.numbers[0] < $1.numbers[0] }

There's also this pitch: Map Sorting

1 Like