let sortedNumbers = numbers.sort { $0 > $1 }
print(sortedNumbers)
Can anyone explain, what $0 and $1 means in swift?>
The refer to the first and second arguments of sort. Here, sort compares 2 elements and order them.
You can look up Swift official documentation for more info:
Swift automatically provides shorthand argument names to inline closures, which can be used to refer to the values of the closure’s arguments by the names $0, $1, $2, and so on.