【发布时间】:2023-03-18 07:05:01
【问题描述】:
我想知道如何在 Swift 中使用sort 或sorted 函数处理多维数组?
例如他们的数组:
[
[5, "test888"],
[3, "test663"],
[2, "test443"],
[1, "test123"]
]
我想按照第一个 ID 从低到高排序:
[
[1, "test123"],
[2, "test443"],
[3, "test663"],
[5, "test888"]
]
那么我们该怎么做呢?谢谢!
【问题讨论】:
标签: arrays swift sorting multidimensional-array