Created
March 7, 2016 06:01
-
-
Save urouro/6ff9c31d10b4788644f5 to your computer and use it in GitHub Desktop.
Coutable enum
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
private enum Example: Int { | |
case FirstItem | |
case SecondItem | |
case ThirdItem | |
static var count: Int { | |
var i = 1 | |
while Example(rawValue: i) != nil { | |
i = i + 1 | |
} | |
return i | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment