// // SaveController.swift // Todos // // Created by Sam Jaffe on 3/1/26. // import Foundation final class SaveController { static func filename(date: String) -> URL { URL.documentsDirectory.appending(path: "Todo \(date).yaml") } static func save(_ items: [Category], to: URL) { let data = Data(items.map({ $0.yaml() }).joined().utf8) do { try data.write(to: to, options: [.atomic, .completeFileProtection]) let input = try String(contentsOf: to, encoding: .utf8) print(input) } catch { print(error.localizedDescription) } } }