Created
September 4, 2017 19:43
-
-
Save RodrigoLGuimaraes/9dd9431b98bd136a720f610a16dbeda4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//: 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