Created
November 18, 2017 14:44
-
-
Save danielmartin/a6964e88cf59ba8ac334a3aa4bf3d03f to your computer and use it in GitHub Desktop.
Simple way to sort an Array in Swift
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
import Foundation | |
let sample = [11, 57, 55, 37, 54, 41, 30, 8, 53, 4, 47, 58, 18, 56, 17, 12, 39, 28, 16, 63, 40, 27, 50, 48, 19, 2, 25, 52, 13, 59, 64, 9, 26, 24, 23, 44, 21, 0, 6, 62, 61, 7, 29, 43, 38, 33, 51, 34, 3, 42, 22, 46, 5, 1, 10, 32, 60, 15, 49, 45, 35, 20, 36, 31] | |
sample.sort { | |
return $0 < $1 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment