Answers for "swift get encode enum data"

3

enum from raw value swift

enum TestEnum: String {
  case Name = "Name"
  case Gender = "Gender"
  case Birth = "Birth Day"
}

let name = TestEnum(rawValue: "Name")!       //Name
let gender = TestEnum(rawValue: "Gender")!   //Gender
let birth = TestEnum(rawValue: "Birth Day")! //Birth
Posted by: Guest on December-19-2020

Code answers related to "Swift"

Browse Popular Code Answers by Language