Skip to content

Instantly share code, notes, and snippets.

@RodrigoLGuimaraes
Created September 4, 2017 19:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RodrigoLGuimaraes/9dd9431b98bd136a720f610a16dbeda4 to your computer and use it in GitHub Desktop.
Save RodrigoLGuimaraes/9dd9431b98bd136a720f610a16dbeda4 to your computer and use it in GitHub Desktop.
//: 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