Slide 7
Slide 7 text
switch
7
func generateText(from index: Int) -> String {
guard let unwrappedType = TestType(rawValue: index) else {
return ""
}
switch unwrappedType {
case .hoge:
return "Hoge"
case .fuga:
return "Fuga"
case .piyo:
return "Piyo"
}
}