Created
December 3, 2015 12:20
-
-
Save m4scosta/69fbcb2d417b7bbf77f2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var a = [1, 4, 6, -1, -7, 8] | |
let ordered = a.sort({(b: Int, c: Int) -> Bool in return b > c }) | |
let reversed = a.sort({b, c in return b > c}) | |
let shortReversed = a.sort({ $0 > $1 }) | |
let veryShortReversed = a.sort(>) | |
print(ordered) | |
print(reversed) | |
print(shortReversed) | |
print(veryShortReversed) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment