如何按多个属性对数组进行排序?
您要找的东西叫做
KeyPathComparator
let sorted = userItems.sorted(using: [.init(\.savedOn, order: .reverse), .init(\.title, order: .reverse)])