enum Hello: String {
case english = "Hello"
case japanese = "Hello!"
case emoji = "ð"
}
let hello1 = Hello(rawValue: "Hello!")
let hello2 = Hello(rawValue: "ÐÑивеÑ")
print(hello1) // Optional(Hello.japanese)
print(hello2) // nil
Comments