// // Tag.swift // Todos // // Created by Sam Jaffe on 3/5/26. // import Foundation import SwiftData @Model final class Tag: Codable { var id: String var task: Task? init(id: String, parent: Task? = nil) { self.id = id self.task = parent } func like(_ str: String) -> Bool { return id.caseInsensitiveCompare(str) == .orderedSame } required init(from decoder: any Decoder) throws { id = try decoder.singleValueContainer().decode(String.self) } func encode(to encoder: any Encoder) throws { var single = encoder.singleValueContainer() try single.encode(id) } }