Created
November 10, 2020 13:46
-
-
Save mkeremkeskin/79cae6b4b1dcfe30d63a2727e58b6cb7 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
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