This repository has been archived on 2026-09-11. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files

32 lines
654 B
Swift

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
}
}