Closed worchyld closed 5 years ago
Disk is a wrapper around Codable
so you could easily have an array of your 'many' type as long as its Codable
.
struct User: Codable {
let photos: [Photo]
}
struct Photo: Codable {
let url: String
}
let user = User(photos: [...])
try Disk.save(user, to: .caches, as: "user.json")
I am wondering if there is any examples of using Disk with simple one to many relationships?