I have this enum:
enum GestureDirection:UInt {
case Up = 1 << 0
case Down = 1 << 1
case Left = 1 << 2
case Right
Swift 2.2 Version : In my case I needed to Convert the String Enum Values to be used in Localisable Strings. So added this method inside my enum.
enum DisplayCellTitle: String {
case Clear
func labelTitle() -> String {
switch self {
case .Clear:
return "LBL_CLEAR".localizedWithComment("Clear")
}
}
}
And then Use it like so :
// Get the localised value of the Cell Label Title
let lblTitle = DisplayCellTitle.labelTitle(cellTitle)()
where cellTitle passed in is just one of these CellTitle Enum Values