import Foundation enum TaskList: String, CaseIterable, Codable, Identifiable { case todo case doing case done var id: String { rawValue } var title: String { switch self { case .todo: "To do" case .doing: "Doing" case .done: "Done" } } } struct TaskItem: Identifiable, Codable, Equatable { let id: UUID var title: String var list: TaskList let createdAt: Date init(id: UUID = UUID(), title: String, list: TaskList = .todo, createdAt: Date = .now) { self.id = id self.title = title self.list = list self.createdAt = createdAt } }