Instantly share code, notes, and snippets.

Embed
What would you like to do?
//: Playground - noun: a place where people can play
import UIKit
enum Animation : String {
case Idle = "Idle"
case Happy = "Happy"
case Sad = "Sad"
case Quiet = "Quiet"
}
func stringToAnimation(_ string : String){
let animType = Animation(rawValue: string)
if(animType == Animation.Idle)
{
print ("Funcionou")
}
else
{
print ("Não Funcionou")
}
}
let response = "Idle"
stringToAnimation(response)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment