Skip to content

Instantly share code, notes, and snippets.

@daehn
Last active September 2, 2015 22:16
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 daehn/834db461278f18460ab7 to your computer and use it in GitHub Desktop.
Save daehn/834db461278f18460ab7 to your computer and use it in GitHub Desktop.
enum Beat {
case NoBeat, BPM(Int), Other(Int)
var value : Int? {
return Mirror(reflecting: self).children.first?.value as? Int
}
}
let enums: [Beat] = [.NoBeat, .BPM(105), .Other(120)]
enums.forEach { print($0.value) }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment