Created
May 19, 2020 18:57
-
-
Save bestiosdeveloper/a4e199f71a908bc4db864fad34561749 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
enum Ranking: Comparable { | |
case platinum(Int) // < | |
case gold // < | |
case silver // < | |
case bronze | |
} | |
let someRanks: = [Ranking.gold, Ranking.platinum(8), Ranking.bronze Ranking.platinum(10), Ranking.silver] | |
someRanks.sorted() | |
print(someRanks) | |
//Result: [Ranking.platinum(10), Ranking.platinum(8), Ranking.gold Ranking.silver, Ranking.bronze] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment