Skip to content

Instantly share code, notes, and snippets.

@daoseng33
Last active November 18, 2018 16:47
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 daoseng33/6489870613cd04eb15c557d0c86c19a6 to your computer and use it in GitHub Desktop.
Save daoseng33/6489870613cd04eb15c557d0c86c19a6 to your computer and use it in GitHub Desktop.
enum SectionType: Int {
case header = 0
case list
static let count: Int = {
var max: Int = 0
while let _ = SectionType(rawValue: max) { max += 1 }
return max
}()
}
print(SectionType.count) // 2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment