Skip to content

Instantly share code, notes, and snippets.

@mkeremkeskin
Created November 10, 2020 13:02
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/9e9abd6f1d78ad0bf8669fe1bd533314 to your computer and use it in GitHub Desktop.
Save mkeremkeskin/9e9abd6f1d78ad0bf8669fe1bd533314 to your computer and use it in GitHub Desktop.
public enum FilterType: String, BaseSelectionType, CaseIterable {
case colorDocument
case blackAndWhite
case colorPhoto
case greyscale
var getDisplayText: String {
switch self {
case .colorDocument:
return Localizable.filterColorDocument
case .blackAndWhite:
return Localizable.filterBlackAndWhite
case .colorPhoto:
return Localizable.filterColorPhoto
case .greyscale:
return Localizable.filterGreyscale
}
}
}
//CaseIterable - allCases example
let filterNames: [String] = FilterType.allCases.map({ (type) -> String in
return type.getDisplayText
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment