Skip to content

Instantly share code, notes, and snippets.

@mkeremkeskin
Created November 10, 2020 13:46
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 mkeremkeskin/79cae6b4b1dcfe30d63a2727e58b6cb7 to your computer and use it in GitHub Desktop.
Save mkeremkeskin/79cae6b4b1dcfe30d63a2727e58b6cb7 to your computer and use it in GitHub Desktop.
public enum FilterType: String, BaseSelectionType, CaseIterable {
case colorDocument = "Color Document"
case blackAndWhite = "Black And White"
case colorPhoto = "Color Photo"
case greyscale = "Greyscale"
}
// getting the raw value
FilterType.allCases.map({ (type) -> String in
print type.rawValue
})
//prints Color Document
//prints Black And White
//prints Color Photo
//prints Greyscale
// raw value initialization
let type = FilterType(rawValue: "Color Document")
print(type.rawValue)
//prints Color Document
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment