Skip to content

Instantly share code, notes, and snippets.

@urouro
Created March 7, 2016 06:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save urouro/6ff9c31d10b4788644f5 to your computer and use it in GitHub Desktop.
Save urouro/6ff9c31d10b4788644f5 to your computer and use it in GitHub Desktop.
Coutable enum
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