saoudrizwan / Disk

Delightful framework for iOS to easily persist structs, images, and data
MIT License
3.08k stars 170 forks source link

Allow retrieve of separate structs in same directory #55

Closed moogle19 closed 2 years ago

moogle19 commented 5 years ago

I added the ability to retrieve an array of structs from a directory, where every struct was saved into a separate file (similar to retrieve of [UIImage] and [Data]). If the path in retrieve() points to a directory and the type is [T], retrieve will iterate over the files inside the directory and tries to decode every file as T. If the path points to a file, the function is the same as before.

I am not sure if this is the most intuitive implementation for the given problem. The are some cases which are not covered in my implementation, e.g. multiple files with arrays inside the same directory would be ignored.

I would be happy about feedback!