I have an enum
with 4 objects inside. I then passed one to a variable
. I'm trying to create a switch statement
to see which object was passed. Here is my code:
enum Collection:Int{
case First=1, Second, Third, Fourth
}
var myCollection : Collection!
// Later on...
myCollection = Collection.Second
// Later on...
switch self.myCollection {
case .Second:
println("Second")
}
But I get the following error:
Enum case 'Second' not found in type 'myViewController.Collection!'
What am I doing wrong, and how can I fix it?