更新时间:2022-04-11 23:53:18
$0
是传递给闭包的第一个参数.$1
是第二个参数,等等.你展示的那个闭包是以下的简写:
$0
is the first parameter passed into the closure. $1
is the second parameter, etc. That closure you showed is shorthand for:
let sortedNumbers = numbers.sort { (firstObject, secondObject) in
return firstObject > secondObject
}