I just read the Apple Documentation regarding enums but I'm still somewhat confused.
Say I have the class named Employee. I want the class employee to have an array of tasks (I guess best option is [String]). But I want each task to have a status that's either .Complete or .Incomplete.
I could have another property inside Tasks called taskName, but I think it's easier to just make the Array store Strings
Here's what I thought so far to write:
class Employee {
class Tasks: Array { // Or [String], I have no idea
enum Status {
case Complete
case Incomplete
}
}
var tasks: Tasks
init?() {
self.tasks = Tasks()
}
}
// Then I guess Employee.tasks[0].Status should work
I know that it's most likely wrong. So how should I do it?