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 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 thepath
inretrieve()
points to a directory and thetype
is[T]
, retrieve will iterate over the files inside the directory and tries to decode every file asT
. If thepath
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!