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
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