Skip to content

Instantly share code, notes, and snippets.

@erica
Created June 11, 2015 23:24
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 erica/a7b561c8eb1b92653681 to your computer and use it in GitHub Desktop.
Save erica/a7b561c8eb1b92653681 to your computer and use it in GitHub Desktop.
extension Features : CustomStringConvertible {
var description : String {
let strings = ["Alarm System", "CD Stereo",
"Chrome Wheels", "Pin Stripes", "Leather Interior",
"Undercoating", "Window Tint"]
var members = [String]()
for (flag, string) in strings.enumerate() where contains(Features(rawValue:1<<(flag + 1))) {
members.append(string)
}
return members.description
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment